\author{Sven van der Meer}
\date{v0.3.3, 19 Jan 1995}


\newcommand{\notenm}[1]{({\bf Note:} #1.)}%                 normal Note:
\newcommand{\noteni}{\notenm{not implemented yet}}%         Note: not implemented
\newcommand{\notenie}[1]{\notenm{not implemented yet, #1}}% Note + #1 on begin
\newcommand{\notenib}[1]{\notenm{#1 not implemented yet}}%  Note + #1 on end

\newcommand{\vdmarg}[1]{{\tt #1}}  % function arguments in description
\newcommand{\vdmfunc}[1]{{\bf #1}} % functions in description
\newcommand{\vdmunix}[1]{{\sl#1}}  % unix related stuff in description
\newcommand{\vdmscr}[1]{{\sl#1}}   % stdscr and curscr
\newcommand{\vdmlines}[1]{{\sl#1}} % for LINES and COLS

\newcommand{\tabref}[1]{table \ref{#1} on page \pageref{#1}}    % for tabular
\newcommand{\figref}[1]{figure \ref{#1} on page \pageref{#1}}   % figures
\newcommand{\secref}[1]{section \ref{#1} on page \pageref{#1}}  % for sections
\newcommand{\funref}[1]{\pageref{#1}}          % reference for functions

\newcommand{\ncver}{1.8.6}   % current ncurses version



\chapter{\label{vdm}Character Cell Graphics}

This chapter deals with screen input and output that is not
pixel based, but character based. When we say character, we mean
a composition of pixels that can be changed depending on a charset.
Your graphic card already offers one or more charsets and operates
by default in text (charset) mode because text can be processed
much faster than pixel graphic.  There is more to do with terminals
than to use them as simple (dumb) and boring text displays. I will
describe how to use the special features that your linux terminal,
especially the linux console, offers.

\begin{itemize}
  \item {\bf printf, sprintf, fprintf, scanf, sscanf, fscanf} \\
        With these functions from \vdmunix{libc} you can output formatted 
        strings to \vdmunix{stdout} (standard output), \vdmunix{stderr}
        (standard error) or other streams defined as \vdmarg{FILE *stream} (files,
        for example). \vdmfunc{Scanf(...)} provides a similar way to read
        formatted input from \vdmunix{stdin}.

  \item {\bf termcap} \\
	The TERMinal CAPabilitie database is a set of terminal
	description entries in the ASCII file /etc/termcap.  Here you
	can find information about how to display special characters,
	how to perform operations (delete, insert characters or lines
	etc) and how to initialize a terminal. The database is used,
	for example, by the editor vi. There are view library functions
	to read and use the terminal capabilities (\vdmunix{see termcap(3x)}).
	With this database, programs can work with a variety of
	terminals with the same code. Using the termcap database and
	library functions provides only low level access to the
	terminal. Changing attributes or colors, parameterized output
	and optimization must be done by the programmer himself.

\item  {\bf terminfo database} \\
	The TERMinal INFOrmation database is based on the termcap
	database and also describes terminal capabilities, but on a
	higher level than termcap.  Using terminfo, the program can
	easily change screen attributes, use special keys such as
	function keys and more. The database can be found in 
	\vdmunix{/usr/lib/terminfo/[A-z,0-9]*}. Every file describes one
	terminal.

  \item {\bf curses} \\
	Terminfo is a good base to use for terminal handling in a
	program. The (BSD-)CURSES library gives you
	high level access to the terminal and is based on the terminfo
	database. Curses allows you to open and manipulate windows on
	the screen, provides a complete set of input and output
	functions, and can alter video attributes in a terminal
	independent manner on more than 150 terminals. The curses
	library can be found in \vdmunix{/usr/lib/libcurses.a}.
	This is the BSD version of curses.

  \item {\bf ncurses} \\
        Ncurses is the next improvement. In version \ncver it should be
        compatible with AT\&T curses as defined in SYSVR4 and has some
        extensions such as color manipulation, special optimization for
        output, terminal specific optimizations,  and more. It has been
        tested on a lot of systems such as Sun-OS, HP and Linux.
        I recommend using ncurses instead of the others. On SYSV Unix
        systems (such as Sun's Solaris) there should exist a curses
        library with
        the same functionality as ncurses (actually the solaris curses
        has some more functions and mouse support).
\end{itemize}

	In the following sections I will describe how to use the
	different packages to access a terminal. With Linux we have the
	GNU-version of termcap and we can use ncurses instead of
	curses.







\section{I/O Function in libc}

\subsection{Formatted Output}\label{sec_formout}

The \vdmfunc{printf(...)} functions in \vdmunix{libc} provide formatted output
and allow transformations of the arguments.

\begin{itemize}
  \item {\tt int fprintf(FILE *stream, const char *format, ...),} \label{fun_fprintf}\\
        will transform the output (arguments to fill in \vdmarg{...}) and 
        write it to \vdmarg{stream}. The format defined in \vdmarg{format}
        will be written, too. The function will return the number of written
        characters or a negative value on error.

        \vdmarg{format} contains two kinds of objects
        \begin{enumerate}
         \item  normal characters for the output and
         \item  information how to transform or format the arguments.
        \end{enumerate}

        Format information must begin with {\it \%} followed by values for the
        format followed by a character for the translation (to print \% by
        itself use {\it  \%\%}). Possible values for the format are:

\begin{itemize}
 \item Flags
  \begin{itemize}
   \item {\tt -} \\
    The formatted argument will be printed on the left margin (default is
    the right margin in the argument field).
   \item {\tt +} \\
    Every number will be printed with a sign, e.g. {\tt +12} or {\tt -2.32}.
  \end{itemize}
 \item Blank \\
  When the first character is not a sign, a blank will be inserted.
 \item {\tt 0} \\
  For numeric transformation the field width will be filled up with {\tt 0}'s
  on the left side.
 \item {\tt \#} \\
  Alternate output depending on the transformation for the argument
  \begin{itemize}
   \item  For {\it o} the first number is a {\it 0}.
   \item  For {\it x} or {\it X} {\it 0x} or {\it 0X} will be printed in
    front of the argument.
   \item  For {\it e}, {\it E}, {\it f} or {\it F} the output has a decimal
    point.
   \item  For {\it g} or {\it G} zeroes on the end of the argument are
    printed.
  \end{itemize}
 \item A number for the minimal field width.\\
  The transformed argument is printed in a field which is at least as big as
  the argument itself. With a number you can make the field width bigger.
  If the formatted argument is smaller, then the field width will be filled
  with zeroes or blanks.
 \item  A point to separate the field width and the precision.
 \item  A number for the precision.
\end{itemize}

        Possible values for the transformation are in \tabref{tab_printf}.

  \item {\tt int printf(const char *format, ...)} \label{fun_printf}\\
        Same as \vdmfunc{fprintf(stdout, ...)}.

  \item {\tt int sprintf(char *s, const char *format, ...)} \label{fun_sprintf}\\
        Same as \vdmfunc{printf(...)}, except that the output will be written
        to the the character pointer \vdmarg{s} (with a following 
        {\it \verb+\+0}).

        \notenm{You must allocate enough memory for \vdmarg{s}}

\item {\tt vprintf(const char *format, va\_list arg)} \label{fun_vprintf}\\
      {\tt vfprintf(FILE *stream, const char *format, va\_list arg)} \label{fun_vfprintf}\\
      {\tt vsprintf(char *s, const char *format, va\_list arg)} \label{fun_vsprintf}\\
      The same as the functions above, only the argument list is set to
      \vdmarg{arg}.
\end{itemize}

\begin{table}
  \caption{Libc - printf transformations} \label{tab_printf}
  \begin{center}
    \begin{tabular}{c|l}
    {\bf Character} &  {\bf Formatted to} \\ \hline
    d,i &  {\it int} signed, decimal \\
    o   &  {\it int} unsigned, octal, without leading 0 \\
    x,X &  {\it int} unsigned, hexadecimal without leading 0x \\
    u   &  {\it int} unsigned, decimal \\
    c   &  {\it int} (unsigned) single character \\
    s   &  {\it char *} up to \verb+\+0 \\
    f   &  {\it double} as [-]mmm.ddd \\
    e,E &  {\it double} as [-]m.dddddde$\pm$xx \\
    g,G &  {\it double} using \%e or \%f as needed \\
    p   &  {\it void *} \\
    n   &  {\it int *} \\
    \%  &  {\it \%} \\
    \end{tabular}
  \end{center}
\end{table}



\subsection{Formatted Input}\label{sec_formin}

Just as \vdmfunc{printf(...)} is used for formatted output you can use 
\vdmfunc{scanf(...)} for formatted input.

\begin{itemize}
  \item {\tt int fscanf(FILE *stream, const char *format, ...)} \label{fun_fscanf}\\
        \vdmfunc{fscanf(...)} reads from \vdmarg{stream} and will transform the
        input with the rules defined in \vdmarg{format}. The results will be
        placed in the arguments given by \vdmarg{...}\notenm{the arguments
        {\bf must} be pointer}. The read ends, when no more transformation
        rules are in \vdmarg{format}. \vdmfunc{fscanf(...)} will return EOF
        when the first transformation reached the file end or some error
        occured. Otherwise it will return the number of transformed arguments.

        \vdmarg{format} can include rules on how to format the input arguments
        (see \tabref{tab_scanf}). It can also include:
        \begin{itemize}
          \item Spaces or tabs, which are ignored.
          \item any normal character (except \%). The characters must be in the
                input on the corresponding position.
          \item transformation rules, which assembled with a {\it \%}, the
                optional character {\it *} (this will permit \vdmfunc{fscanf(...)}
                to assign
                to an argument), an optional number, an optional character
                {\it h, l or L} (this is for the length of the target) and the
                transformation character.
  \end{itemize}

  \item {\tt int scanf(const char *format, ...)} \label{fun_scanf}\\
        The same as \vdmfunc{fscanf(stdin,...)}.

  \item {\tt int sscanf(char *str, const char *format, ...)} \label{fun_sscanf}\\
        As \vdmfunc{scanf(...)}, but the input comes from \vdmarg{str}.
\end{itemize}


\begin{table}
  \caption{Libc - scanf transformations} \label{tab_scanf}
  \begin{center}
    \begin{tabular}{c|l}
    {\bf Character} &  {\bf Input - Argumenttyp} \\ \hline
    d   &  decimal integer - {\it int *}\\
    i   &  integer - {\it int *} (input can be octal or hex)\\
    o   &  octal integer - {\it int *} (with or without leading 0)\\
    u   &  decimal, unsigned - {\it unsigned int *}\\
    x   &  hex integer - {\it int *} (with or without leading 0x)\\
    c   &  one or more characters - {\it char *} (without \verb+\+0)\\
    s   &  characters(without space, tab ...) - {\it char *} (with \verb+\+0)\\
e,f,gf  &  float - {\it float *} (e.g [-]m.dddddde$\pm$xx)\\
    p   &  pointer - {\it void *}\\
    n   &  number of transformed arguments - {\it int *}\\
$[...]$ &  nonempty characters in input - {\it char *}\\
$[$\^{}$...]$ &  exclude those nonempty characters - {\it char *}\\
    \%  &  {\it \%}\\ \hline
    \multicolumn{2}{l}{{\it h} can be before d,i,n,o,u and x when the pointer is {\it short}}\\
    \multicolumn{2}{l}{{\it l} can be before d,i,n,o,u and x when the pointer is {\it long}}\\
    \multicolumn{2}{l}{{\it l} can be before e,f and g when the pointer is {\it double}}\\
    \multicolumn{2}{l}{{\it L} can be before e,f and g when the pointer is {\it long double}}\\
    \end{tabular}
  \end{center}
\end{table}







\section{The Termcap Library}


\subsection{Introduction}

The termcap library is an API to the termcap database which can be
found in \vdmunix{/etc/termcap/}. The library functions allow
the following actions:

\begin{itemize}
  \item Get a description of the current terminal: \vdmfunc{tgetent(...)}.
  \item Search the description for information:
        \vdmfunc{tgetnum(...)}, \vdmfunc{tgetflag(...)}, 
        \vdmfunc{tgetstr(...)}.
  \item Encode numeric parameters in a terminal specific form:
        \vdmfunc{tparam(...)}, \vdmfunc{tgoto(...)}.
  \item Compute and perform padding \vdmfunc{tputs(...)}.
\end{itemize}

Programs using the termcap library must include \vdmunix{termcap.h}
and should be linked with:

\begin{tscreen}
\begin{verbatim}
    gcc [flags] files -ltermcap
\end{verbatim}
\end{tscreen}

Termcap functions are terminal independent routines but only give
the programmer low level access to the terminal.
For a higher level package, curses or ncurses should be used.


\subsection{Find a Terminal Description}

\begin{itemize}
  \item {\tt int tgetent(void *buffer, const char *termtype)} \label{fun_tgetent}\\
      On the Linux operating system the current terminal name is
      contained in the environment variable \vdmunix{TERM}. So,
      \vdmarg{termtype} is the result of a call to \vdmunix{getenv(3)}.

      For \vdmarg{buffer}, no memory has to be allocated when using the GNU
      version of termcap.  This is what we can assume under Linux!
      Otherwise, you'll have to allocate 2048 Bytes.
      (Formerly, \vdmarg{buffer} only needed to be 1024 Bytes, but
      the size has doubled).

     \vdmfunc{tgetent(...)} returns 1 on success and 0 when the
     database is found but has no entry for TERM. Other errors will
     return different values.

     The following example should explain how to use \vdmfunc{tgetent(...)}:

\begin{tscreen}
\begin{verbatim}
    #define buffer 0
    char *termtype=getenv("TERM");
    int ok;

    ok=tgetent(buffer,termtype);
    if(ok==1)
      /* all right, we have the entry */
    else if(ok==0)
     /* uups, something wrong with TERM
      * check termtype first, then termcap database
      */
    else
     /* huuu, fatal error */
\end{verbatim}
\end{tscreen}

	By, default termcap uses \vdmunix{/etc/termcap/} as the database.
	If the environment variable TERMCAP is set, with
	\vdmunix{\$HOME/mytermcap}
	for instance, all functions will use \vdmunix{mytermcap}
	instead of \vdmunix{/etc/termcap}.  With no leading
	slash in TERMCAP, the defined value is used as a name for a
	terminal.  \end{itemize}

\subsection{Look at a Terminal Description}

Every piece of information is called a capability, every capability is
a two letter code, and every two letter code is followed by the value
for the capability.  Possible types are:

\begin{itemize}
  \item  {\bf Numeric}: For instance {\it co} -- number of columns
  \item  {\bf Boolean} or {\bf Flag}: For instance {\it hc} -- hardcopy
         terminal
  \item  {\bf String}: For instance {\it st} -- set tab stop
\end{itemize}

Each capability is associated with a single value type. ({\it co}
is always numeric, {\it hc} is always a flag and {\it st} is always a string).
There are three different types of values, so there are also three functions to
interrogate them. \vdmarg{char *name} is the two letter code for the capability.

\begin{itemize}
  \item {\tt int tgetnum(char *name)} \label{fun_tgetnum}\\
        Get a capability value that is numeric, such as {\it co}.
        \vdmfunc{tgetnum(...)} returns the numeric value if the capability is
        available, otherwise 1.
        (Note: the returned value is not negative.)

  \item {\tt int tgetflag(char *name)} \label{fun_tgetflag}\\
        Get a capability value that is boolean (or flag).
        Returns 1 if the flag is present, 0 otherwise.

  \item {\tt char *tgetstr(char *name, char **area)} \label{fun_tgetstr}\\
	Get a capability value that is a string. Returns a pointer to
	the string or NULL if not present. In the GNU version, if
	\vdmarg{area} is NULL, termcap will allocate memory by
	itself.  Termcap will never refer to this pointer again, so
	don't forget to free \vdmarg{name} before leaving the
	program.  This method is preferred, because you don't know how
	much space is needed for the pointer, so let termcap do this
	for you.
\end{itemize}


\begin{tscreen}
\begin{verbatim}
    char *clstr, *cmstr;
    int   lines,  cols;

    void term_caps()
    {
    char *tmp;

     clstr=tgetstr("cl",0); /* clear screen */
     cmstr=tgetstr("cm",0); /* move y,x     */

     lines=tgetnum("li"); /* terminal lines   */
     cols=tgetnum("co");  /* terminal columns */

     tmp=tgetstr("pc",0); /* padding character */

     PC=tmp ? *tmp : 0;
     BC=tgetstr("le",0); /* cursor left one char */
     UP=tgetstr("up",0); /* cursor up one line   */
    }
\end{verbatim}
\end{tscreen}



\subsection{Termcap Capabilities}

\subsubsection{Boolean Capabilities}
\begin{small}
\begin{tabbing}
1234\=\kill
{\tt 5i} \>   Printer will not echo on screen\\
{\tt am} \>   Automatic margins which means automatic line wrap\\
{\tt bs} \>   Control-H (8 dec.) performs a backspace\\
{\tt bw} \>   Backspace on left margin wraps to previous line and right margin\\
{\tt da} \>   Display retained above screen\\
{\tt db} \>   Display retained below screen\\
{\tt eo} \>   A space erases all characters at cursor position\\
{\tt es} \>   Escape sequences and special characters work in status line\\
{\tt gn} \>   Generic device\\
{\tt hc} \>   This is a hardcopy terminal\\
{\tt HC} \>   The cursor is hard to see when not on bottom line\\
{\tt hs} \>   Has a status line\\
{\tt hz} \>   Hazel tine bug, the terminal can not print tilde characters\\
{\tt in} \>   Terminal inserts nulls, not spaces, to fill whitespace\\
{\tt km} \>   Terminal has a meta key\\
{\tt mi} \>   Cursor movement works in insert mode\\
{\tt ms} \>   Cursor movement works in standout/underline mode\\
{\tt NP} \>   No pad character\\
{\tt NR} \>   ti does not reverse te\\
{\tt nx} \>   No padding, must use XON/XOFF\\
{\tt os} \>   Terminal can overstrike\\
{\tt ul} \>   Terminal underlines although it can not overstrike\\
{\tt xb} \>   Beehive glitch, f1 sends ESCAPE, f2 sends \^{}C\\
{\tt xn} \>   Newline/wraparound glitch\\
{\tt xo} \>   Terminal uses xon/xoff protocol\\
{\tt xs} \>   Text typed over standout text will be displayed in standout\\
{\tt xt} \>   Teleray glitch, destructive tabs and odd standout mode\\
\end{tabbing}
\end{small}

\subsubsection{Numeric Capabilities}
\begin{small}
\begin{multicols}{2}
\begin{tabbing}
1234\=\kill
{\tt co} \>   Number of columns\\
{\tt dB} \>   Delay in milliseconds for backspace\\
         \>   on hardcopy terminals\\
{\tt dC} \>   Delay in milliseconds for carriage\\
         \>   return on hardcopy terminals\\
{\tt dF} \>   Delay in milliseconds for form feed\\
         \>   on hardcopy terminals\\
{\tt dN} \>   Delay in milliseconds for new line\\
         \>   on hardcopy terminals\\
{\tt dT} \>   Delay in milliseconds for tab stop\\
         \>   on hardcopy terminals\\
{\tt dV} \>   Delay in milliseconds for vertical\\
         \>   tab stop on hardcopy terminals\\
{\tt it} \>   Difference between tab positions\\
{\tt lh} \>   Height of soft labels\\
{\tt lm} \>   Lines of memory\\
{\tt lw} \>   Width of soft labels\\
{\tt li} \>   Number of lines\\
{\tt Nl} \>   Number of soft labels\\
{\tt pb} \>   Lowest baud rate which needs\\
         \>   padding\\
{\tt sg} \>   Standout glitch\\
{\tt ug} \>   Underline glitch\\
{\tt vt} \>   virtual terminal number\\
{\tt ws} \>   Width of status line if\\
         \>   different from screen width\\
\end{tabbing}
\end{multicols}
\end{small}
%\clearpage

\subsubsection{String Capabilities}
\begin{small}
\begin{multicols}{2}
\begin{tabbing}
1234\=\kill
{\tt !1} \>   shifted save key\\
{\tt !2} \>   shifted suspend key\\
{\tt !3} \>   shifted undo key\\
{\tt \#1} \>  shifted help key\\
{\tt \#2} \>  shifted home key\\
{\tt \#3} \>  shifted input key\\
{\tt \#4} \>  shifted cursor left key\\
{\tt \%0} \>  redo key\\
{\tt \%1} \>  help key\\
{\tt \%2} \>  mark key\\
{\tt \%3} \>  message key\\
{\tt \%4} \>  move key\\
{\tt \%5} \>  next-object key\\
{\tt \%6} \>  open key\\
{\tt \%7} \>  options key\\
{\tt \%8} \>  previous-object key\\
{\tt \%9} \>  print key\\
{\tt \%a} \>  shifted message key\\
{\tt \%b} \>  shifted move key\\
{\tt \%c} \>  shifted next key\\
{\tt \%d} \>  shifted options key\\
{\tt \%e} \>  shifted previous key\\
{\tt \%f} \>  shifted print key\\
{\tt \%g} \>  shifted redo key\\
{\tt \%h} \>  shifted replace key\\
{\tt \%i} \>  shifted cursor right key\\
{\tt \%j} \>  shifted resume key\\
{\tt \&0} \>  shifted cancel key\\
{\tt \&1} \>  reference key\\
{\tt \&2} \>  refresh key\\
{\tt \&3} \>  replace key\\
{\tt \&4} \>  restart key\\
{\tt \&5} \>  resume key\\
{\tt \&6} \>  save key\\
{\tt \&7} \>  suspend key\\
{\tt \&8} \>  undo key\\
{\tt \&9} \>  shifted begin key\\
{\tt *0} \>   shifted find key\\
{\tt *1} \>   shifted command key\\
{\tt *2} \>   shifted copy key\\
{\tt *3} \>   shifted create key\\
{\tt *4} \>   shifted delete character\\
{\tt *5} \>   shifted delete line\\
{\tt *6} \>   select key\\
{\tt *7} \>   shifted end key\\
{\tt *8} \>   shifted clear line key\\
{\tt *9} \>   shifted exit key\\
{\tt \@0} \>   find key\\
{\tt \@1} \>   begin key\\
{\tt \@2} \>   cancel key\\
{\tt \@3} \>   close key\\
{\tt \@4} \>   command key\\
{\tt \@5} \>   copy key\\
{\tt \@6} \>   create key\\
{\tt \@7} \>   end key\\
{\tt \@8} \>   enter/send key\\
{\tt \@9} \>   exit key\\
{\tt al} \>   Insert one line\\
{\tt AL} \>   Insert \%1 lines\\
{\tt ac} \>   Pairs of block graphic characters to\\ 
         \>   map alternate character set\\
{\tt ae} \>   End alternative character set\\
{\tt as} \>   Start alternative character set\\
         \>   for block graphic characters\\
{\tt bc} \>   Backspace, if not \^{}H\\
{\tt bl} \>   Audio bell\\
{\tt bt} \>   Move to previous tab stop\\
{\tt cb} \>   Clear from beginning of line\\
         \>   to cursor\\
{\tt cc} \>   Dummy command character\\
{\tt cd} \>   Clear to end of screen\\
{\tt ce} \>   Clear to end of line\\
{\tt ch} \>   Move cursor horizontally only to\\
              column \%1\\
{\tt cl} \>   Clear screen and cursor home\\
{\tt cm} \>   Cursor move to row \%1 and\\
              column \%2 (on screen)\\
{\tt CM} \>   Move cursor to row \%1 and\\
              column \%2 (in memory)\\
{\tt cr} \>   Carriage return\\
{\tt cs} \>   Scroll region from line \%1 to \%2\\
{\tt ct} \>   Clear tabs\\
{\tt cv} \>   Move cursor vertically only to\\
         \>   line \%1\\
{\tt dc} \>   Delete one character\\
{\tt DC} \>   Delete \%1 characters\\
{\tt dl} \>   Delete one line\\
{\tt DL} \>   Delete \%1 lines\\
{\tt dm} \>   Begin delete mode\\
{\tt do} \>   Cursor down one line\\
{\tt DO} \>   Cursor down \#1 lines\\
{\tt ds} \>   Disable status line\\
{\tt eA} \>   Enable alternate character set\\
{\tt ec} \>   Erase \%1 characters starting at\\
         \>   cursor\\
{\tt ed} \>   End delete mode\\
{\tt ei} \>   End insert mode\\
{\tt ff} \>   Form-feed character on hardcopy\\
         \>   terminals\\
{\tt fs} \>   Return character to its position\\
         \>   before going to status line\\
{\tt F1} \>   The string sent by function key f11\\
{\tt F2} \>   The string sent by function key f12\\
{\tt F3} \>   The string sent by function key f13\\
         \>   ...  ...\\
{\tt F9} \>   The string sent by function key f19\\
{\tt FA} \>   The string sent by function key f20\\
{\tt FB} \>   The string sent by function key f21\\
         \>   ...  ...\\
{\tt FZ} \>   The string sent by function key f45\\
{\tt Fa} \>   The string sent by function key f46\\
{\tt Fb} \>   The string sent by function key f47\\
         \>   ...  ...\\
{\tt Fr} \>   The string sent by function key f63\\
{\tt hd} \>   Move cursor a half line down\\
{\tt ho} \>   Cursor home\\
{\tt hu} \>   Move cursor a half line up\\
{\tt i1} \>   Initialization string 1 at login\\
{\tt i3} \>   Initialization string 3 at login\\
{\tt is} \>   Initialization string 2 at login\\
{\tt ic} \>   Insert one character\\
{\tt IC} \>   Insert \%1 characters\\
{\tt if} \>   Initialization file\\
{\tt im} \>   Begin insert mode\\
{\tt ip} \>   Insert pad time and needed special\\
         \>   characters after insert\\
{\tt iP} \>   Initialization program\\
{\tt K1} \>   upper left key on keypad\\
{\tt K2} \>   center key on keypad\\
{\tt K3} \>   upper right key on keypad\\
{\tt K4} \>   bottom left key on keypad\\
{\tt K5} \>   bottom right key on keypad\\
{\tt k0} \>   Function key 0\\
{\tt k1} \>   Function key 1\\
{\tt k2} \>   Function key 2\\
{\tt k3} \>   Function key 3\\
{\tt k4} \>   Function key 4\\
{\tt k5} \>   Function key 5\\
{\tt k6} \>   Function key 6\\
{\tt k7} \>   Function key 7\\
{\tt k8} \>   Function key 8\\
{\tt k9} \>   Function key 9\\
{\tt k;} \>   Function key 10\\
{\tt ka} \>   Clear all tabs key\\
{\tt kA} \>   Insert line key\\
{\tt kb} \>   Backspace key\\
{\tt kB} \>   Back tab stop\\
{\tt kC} \>   Clear screen key\\
{\tt kd} \>   Cursor down key\\
{\tt kD} \>   Key for delete character\\
         \>   under cursor\\
{\tt ke} \>   turn keypad off\\
{\tt kE} \>   Key for clear to end of line\\
{\tt kF} \>   Key for scrolling forward/down\\
{\tt kh} \>   Cursor home key\\
{\tt kH} \>   Cursor home down key\\
{\tt kI} \>   Insert character/Insert mode key\\
{\tt kl} \>   Cursor left key\\
{\tt kL} \>   Key for delete line\\
{\tt kM} \>   Key for exit insert mode\\
{\tt kN} \>   Key for next page\\
{\tt kP} \>   Key for previous page\\
{\tt kr} \>   Cursor right key\\
{\tt kR} \>   Key for scrolling backward/up\\
{\tt ks} \>   Turn keypad on\\
{\tt kS} \>   Clear to end of screen key\\
{\tt kt} \>   Clear this tab key\\
{\tt kT} \>   Set tab here key\\
{\tt ku} \>   Cursor up key\\
{\tt l0} \>   Label of zeroth function key,\\
         \>   if not f0\\
{\tt l1} \>   Label of first function key,\\
         \>   if not f1\\
{\tt l2} \>   Label of first function key,\\
         \>   if not f2\\
         \>   ...  ...\\
{\tt la} \>   Label of tenth function key,\\
         \>   if not f10\\
{\tt le} \>   Cursor left one character\\
{\tt ll} \>   Move cursor to lower left corner\\
{\tt LE} \>   Cursor left \%1 characters\\
{\tt LF} \>   Turn soft labels off\\
{\tt LO} \>   Turn soft labels on\\
{\tt mb} \>   Start blinking\\
{\tt MC} \>   Clear soft margins\\
{\tt md} \>   Start bold mode\\
{\tt me} \>   End all mode like so, us, mb,\\
              md and mr\\
{\tt mh} \>   Start half bright mode\\
{\tt mk} \>   Dark mode (Characters invisible)\\
{\tt ML} \>   Set left soft margin\\
{\tt mm} \>   Put terminal in meta mode\\
{\tt mo} \>   Put terminal out of meta mode\\
{\tt mp} \>   Turn on protected attribute\\
{\tt mr} \>   Start reverse mode\\
{\tt MR} \>   Set right soft margin\\
{\tt nd} \>   Cursor right one character\\
{\tt nw} \>   Carriage return command\\
{\tt pc} \>   Padding character\\
{\tt pf} \>   Turn printer off\\
{\tt pk} \>   Program key \%1 to send string \%2\\
         \>   as if typed by user\\
{\tt pl} \>   Program key \%1 to execute string\\
         \>   \%2 in local mode\\
{\tt pn} \>   Program soft label \%1 to to show\\
         \>   string \%2\\
{\tt po} \>   Turn the printer on\\
{\tt pO} \>   Turn the printer on for \%1\\
         \>   ($<$256) bytes\\
{\tt ps} \>   Print screen contents on printer\\
{\tt px} \>   Program key \%1 to send string\\
         \>   \%2 to computer\\
{\tt r1} \>   Reset string 1, set sane modes\\
{\tt r2} \>   Reset string 2, set sane modes\\
{\tt r3} \>   Reset string 3, set sane modes\\
{\tt RA} \>   disable automatic margins\\
{\tt rc} \>   Restore saved cursor position\\
{\tt rf} \>   Reset string file name\\
{\tt RF} \>   Request for input from terminal\\
{\tt RI} \>   Cursor right \%1 characters\\
{\tt rp} \>   Repeat character \%1 for \%2 times\\
{\tt rP} \>   Padding after character sent in\\
         \>   replace mode\\
{\tt rs} \>   Reset string\\
{\tt RX} \>   Turn off XON/XOFF flow control\\
{\tt sa} \>   Set \%1 \%2 \%3 \%4 \%5 \%6 \%7 \%8\\
         \>   \%9 attributes\\
{\tt SA} \>   enable automatic margins\\
{\tt sc} \>   Save cursor position\\
{\tt se} \>   End standout mode\\
{\tt sf} \>   Normal scroll one line\\
{\tt SF} \>   Normal scroll \%1 lines\\
{\tt so} \>   Start standout mode\\
{\tt sr} \>   Reverse scroll\\
{\tt SR} \>   scroll back \%1 lines\\
{\tt st} \>   Set tabulator stop in all rows at \\
         \>   current column\\
{\tt SX} \>   Turn on XON/XOFF flow control\\
{\tt ta} \>   move to next hardware tab\\
{\tt tc} \>   Read in terminal description from \\
         \>   another entry\\
{\tt te} \>   End program that uses\\
         \>   cursor motion\\
{\tt ti} \>   Begin program that uses\\
         \>   cursor motion\\
{\tt ts} \>   Move cursor to column \%1 of\\
         \>   status line\\
{\tt uc} \>   Underline character under cursor\\
         \>   and move cursor right\\
{\tt ue} \>   End underlining\\
{\tt up} \>   Cursor up one line\\
{\tt UP} \>   Cursor up \%1 lines\\
{\tt us} \>   Start underlining\\
{\tt vb} \>   Visible bell\\
{\tt ve} \>   Normal cursor visible\\
{\tt vi} \>   Cursor invisible\\
{\tt vs} \>   Standout cursor\\
{\tt wi} \>   Set window from line \%1 to \%2\\
         \>   and column \%3 to \%4\\
{\tt XF} \>   XOFF character if not \^{}S\\
\end{tabbing}
\end{multicols}
\end{small}



\clearpage



\section{Ncurses - Introduction}

The following terminology will be used in this chapter:

\begin{itemize}
  \item  window - is an internal representation containing an image
                  of a part of the screen. WINDOW is defined in
                  \vdmunix{ncurses.h}.
  \item  screen - is a window with the size of the entire screen (from the
                  upper left to the lower right). \vdmscr{Stdscr} and
                  \vdmscr{curscr} are screens.
  \item  terminal - is a special screen with information about what the screen
                    currently looks like.
  \item  variables - the following variables and constants defined in
                     \vdmunix{ncurses.h}
    \begin{itemize}
      \item  WINDOW *curscr - current screen
      \item  WINDOW *stdscr - standard screen
      \item  int LINES - lines on the terminal
      \item  int COLS - columns on the terminal
      \item  bool TRUE - true flag, 1
      \item  bool FALSE - false flag, 0
      \item  int ERR - error flag, -1
      \item  int OK - ok flag, 0
    \end{itemize}
  \item  functions - in the function description the arguments are of the
         following type:
    \begin{itemize}
      \item win - WINDOW*
      \item bf - bool
      \item ch - chtype
      \item str - char*
      \item chstr - chtype*
      \item fmt - char*
      \item otherwise int
    \end{itemize}
\end{itemize}

Usually a program using the ncurses library looks like this:

\begin{tscreen}
\begin{verbatim}
    #include <ncurses.h>
    ...
    main()
    {
      ...
      initscr();
      /* ncurses function calls */
      endwin();
      ...
    }
\end{verbatim}
\end{tscreen}

Including \vdmunix{ncurses.h} will define variables and types for ncurses, such
as WINDOW and function prototypes. It automatically includes \vdmunix{stdio.h},
\vdmunix{stdarg.h}, \vdmunix{termios.h} and \vdmunix{unctrl.h}.

\vdmfunc{initscr()} is used to initialize the ncurses data structures and to
read the proper terminfo file. Memory for
\vdmscr{stdscr} and \vdmscr{curscr} will be allocated. If an error occurs,
initscr will return ERR, otherwise a pointer to \vdmscr{stdscr} will be
returned.  Additionally, the
screen will be erased and \vdmlines{LINES} and \vdmlines{COLS} will be initialized.

\vdmfunc{endwin()} will clean up all allocated resources from ncurses and
restore the tty modes to the status they had before calling 
\vdmfunc{initscr()}. It must be called before any other function from the 
ncurses library and \vdmfunc{endwin()} must be called before your program
exits. When you want to do output to more than one terminal, you can use
\vdmfunc{newterm(...)} instead of \vdmfunc{initscr()}.

Compile the program with:

\begin{tscreen}
\begin{verbatim}
    gcc [flags] files -lncurses
\end{verbatim}
\end{tscreen}

In flags you can include anything you like (\vdmunix{see gcc(1)}). Since the
path for ncurses.h has changed you have to include the following line:

\begin{tscreen}
\begin{verbatim}
    -I/usr/include/ncurses
\end{verbatim}
\end{tscreen}

Otherwise, ncurses.h, nterm.h, termcap.h and unctrl.h will not be found. 
Possible other flags for Linux are:

\begin{tscreen}
\begin{verbatim}
    -O2 -ansi -Wall -m486
\end{verbatim}
\end{tscreen}

\vdmunix{O2} tells gcc to do some optimization, \vdmunix{-ansi} is for ansi
conformant c-code, \vdmunix{-Wall} will print out all warnings, 
\vdmunix{-m486} will use optimized code for an Intel 486 (the binary can be
used on an Intel 386, too).

The ncurses library can be found in /usr/lib/.  There are three versions
of the ncurses library:
\begin{itemize}
  \item  {\bf libncurses.a} the normal ncurses library.
  \item  {\bf libdcurses.a} ncurses for debugging.
  \item  {\bf libpcurses.a} ncurses for profiling (since \ncver
         libpcurses.a exists no longer ?).
  \item  {\bf libcurses.a} No fourth version, but the original BSD curses
         (in my slackware 2.1.0 it is the bsd package).
\end{itemize}

The data structures for the screen are called {\it windows} as defined in
\vdmunix{ncurses.h}.  A window is something like a character
array in memory which the programmer can manipulate without
output to the terminal.  The default window is \vdmscr{stdscr} with the size of
the terminal.  You can create other windows with \vdmfunc{newwin(...)}.

To update the physical terminal optimally, ncurses has another window
declared, \vdmscr{curscr}. This is an image of how the terminal
actually looks and \vdmscr{stdscr} is an image of how the terminal should look.
The output will be done when you call \vdmfunc{refresh()}. Ncurses will then
update \vdmscr{curscr} and the physical terminal with the information in
\vdmscr{stdscr}.
The library functions will use internal optimization for the update process so 
you can
change different windows and then update the screen at once in the most
optimal way.

With the ncurses functions you can manipulate the data structure
{\it window}. Functions beginning with {\it w} allow you to
specify a {\it window}, while
others will usually affect \vdmscr{stdscr}. Functions beginning with {\it mv}
will move the cursor to the position {\it y,x} first.

A character has the type {\it chtype} which is {\it long unsigned int} to
store additional information about it (attributes etc.).

Ncurses use the \vdmunix{terminfo} database. Normally the database is
located in \vdmunix{usr/lib/terminfo/} and ncurses will look there for
local terminal definitions. If you want to test some other
definitions for a terminal without changing the original terminfo, set the
environment variable \vdmunix{TERMINFO}. Ncurses will check this variable
and use the definitions stored there instead of /usr/lib/terminfo/.

Current ncurses version is \ncver (\date).

At the end of this chapter you can find a table with an overview for
the BSD-Curses, ncurses and the curses from Sun-OS 5.4. Refer to it
when you want to look for a specific function and where it is implemented.




\section{Initializing}

\begin{itemize}

  \item {\tt WINDOW *initscr()} \label{fun_initscr}\\
        This is the first function usually called from a program using ncurses.
        In some cases it is useful to call \vdmfunc{slk\_init(int)}, 
        \vdmfunc{filter()}, \vdmfunc{ripoffline(...)} or \vdmfunc{use\_env(bf)}
        before \vdmfunc{initscr()}. When using multiple terminals (or perhaps
        testing capabilities), you can use \vdmfunc{newterm(...)} instead
        of \vdmfunc{initscr()}.

        \vdmfunc{initscr()} will read the proper terminfo file and initialize
        the ncurses data structures, allocate memory for \vdmscr{curscr} and
        \vdmscr{stdscr} and set \vdmlines{LINES} and \vdmlines{COLS} to the values the
        terminal has. It will return a pointer to \vdmscr{stdscr} or ERR when
        an error has occured. You don't need to initialize the pointer with:
\begin{tscreen}
\begin{verbatim}
    stdscr=initscr();
\end{verbatim}
\end{tscreen}
        \vdmfunc{initscr()} will do this for you. If the return value is 
        ERR, your program should exit because no ncurses function will work:
\begin{tscreen}
\begin{verbatim}
    if(!(initscr())){
      fprintf(stderr,"type: initscr() failed\n\n");
      exit (1);
    }
\end{verbatim}
\end{tscreen}

  \item {\tt SCREEN *newterm(char *type, FILE *outfd, FILE *infd)} \label{fun_newterm}\\
        For multiple terminal output call \vdmfunc{newterm(...)} for every
        terminal you would access with ncurses instead of \vdmfunc{initscr()}. 
        \vdmarg{type} is the name of the terminal as contained in \$TERM (ansi,
        xterm, vt100, for example), \vdmarg{outfd} is the output pointer and
        \vdmarg{infd} is the pointer used for input. Call \vdmfunc{endwin()}
        for every terminal opened with \vdmfunc{newterm(...)}.

  \item {\tt SCREEN *set\_term(SCREEN *new)} \label{fun_set_term}\\
        With \vdmfunc{set\_term(SCREEN)} you can switch the current terminal.
        All functions will affect the current terminal which is set with
        \vdmfunc{set\_term(SCREEN)}.

  \item {\tt int endwin()} \label{fun_endwin}\\
        \vdmfunc{endwin()} will do the cleanup, restore the terminal modes in
        the state they had before calling \vdmfunc{initscr()} and move the
        cursor to the lower left corner. Don't forget to close all opened 
        windows before you call \vdmfunc{endwin()} to exit your
        program.

        An additional call to \vdmfunc{refresh()} after \vdmfunc{endwin()}
        will restore the terminal to the status it had before calling
        \vdmfunc{initscr()} (visual-mode) otherwise it will be cleared
        (non-visual-mode).

  \item {\tt int isendwin()} \label{fun_isendwin}\\
        Returns TRUE if \vdmfunc{endwin()} was called with a following
        \vdmfunc{refresh()}, otherwise FALSE.


  \item {\tt void delscreen(SCREEN* sp)} \label{fun_delscreen}\\
        After \vdmfunc{endwin()} call \vdmfunc{delscreen(SCREEN)} to free up all
        occupied resources, when SCREEN is no longer needed.
        \noteni
\end{itemize}




\section{Windows}

Windows can be created, deleted, moved, copied, touched, duplicated and more.

\begin{itemize}
  \item {\tt WINDOW *newwin(nlines, ncols, begy, begx)} \label{fun_newwin}\\
        \vdmarg{begy} and \vdmarg{begx} are
        the window coordinates of the upper left corner. \vdmarg{nlines}
        is an integer with the number of lines and \vdmarg{ncols} is an integer
        with the number of columns.

        \begin{figure}
          \caption{Ncurses - scheme for newwin} \label{fig_newwin}
          \begin{center}
            \input{newwin.tex}
          \end{center}
        \end{figure}

\begin{tscreen}
\begin{verbatim}
    WINDOW *mywin;
    mywin=newwin(10,60,10,10);
\end{verbatim}
\end{tscreen}

       The upper left corner of our window is in line 10
       and column 10 and the window has 10 lines and 60 columns. If
       \vdmarg{nlines}
       is zero, the window will have $LINES-begy$ rows. In the same way the,
       window will have $COLS-begx$ columns when \vdmarg{ncols} is zero.

       When you call \vdmfunc{newwin(...)} with all argument zero:
\begin{tscreen}
\begin{verbatim}
    WINDOW *mywin;
    mywin=newwin(0,0,0,0);
\end{verbatim}
\end{tscreen}
       the opened window will have the size of the screen.

       With \vdmlines{LINES} and \vdmlines{COLS} we can open windows in the middle of
       the screen,
       whatever dimension it has:

\begin{tscreen}
\begin{verbatim}
    #define MYLINE (int) ((LINES-22)/2)
    #define MYCOL ((COLS-70)/2)
    #define MYLINES 22
    #define MYCOLS  70
    ...
    WINDOW *win;
    ...
    if(!(initscr())){
      fprintf(stderr,"type: initscr() failed\n\n");
      exit(1);
    }
    ...
    if ((LINES<22)||(COLS<70)){
      fprintf(stderr,"screen to small\n\n");
      endwin(); exit (1);
    }
    win=newwin(MYLINES,MYCOLS,MYLINE,MYCOL);
    ...
\end{verbatim}
\end{tscreen}

        This will open a window with 22 lines and 70 rows in the middle
        of the screen. Check the screen size before opening windows.
        In the Linux console we have 25 or more lines and 80 or more
        columns, but in xterms this may not be the case (they're resizable).

        Alternatively, use \vdmlines{LINES} and \vdmlines{COLS} to adapt
        two windows to the screen size:

\begin{tscreen}
\begin{verbatim}
    #define MYROWS   (int) (LINES/2+LINES/4)
    #define MYCOLS   (int) (COLS/2+COLS/4)
    #define LEFTROW  (int) ((LINES-MYROWS)/2)
    #define LEFTCOL  (int) (((COLS-2)-MYCOLS)/2)
    #define RIGHTROW (int) (LEFTROW)
    #define RIGHTCOL (int) (LEFTROW+2+MYCOLS)
    #define WCOLS    (int) (MYCOLS/2)
    ...
    WINDOW *leftwin, *rightwin;
    ...
    leftwin=newwin(MYROWS, WCOLS, LEFTROW, LEFTCOL);
    rightwin=newwin(MYROWS, WCOLS, RIGHTROW, RIGHTCOL);
    ...
\end{verbatim}
\end{tscreen}

See \vdmunix{screen.c} in the example directory for more explanations.

  \item {\tt int delwin(win)} \label{fun_delwin}\\
        Delete the window \vdmarg{win}. When there are subwindows delete them
        before \vdmarg{win}. It will free up all resources
        occupied by \vdmarg{win}. Delete all windows you have
        opened before calling \vdmfunc{endwin()}.

  \item {\tt int mvwin(win, by, bx)} \label{fun_mvwin}\\
        Will move a window to the coordinates \vdmarg{by,bx}.
        If this means moving the window beyond the edges of the screen,
        nothing is done, and ERR is returned.

  \item {\tt WINDOW *subwin(origwin, nlines, ncols, begy, begx)} \label{fun_subwin}\\
        Returns a subwindow in the middle of \vdmarg{origwin}. When you change
        one of the two windows (\vdmarg{origwin} or the new one) this change
        will be reflected in both windows. Call \vdmfunc{touchwin(origwin)}
        before the next \vdmfunc{refresh()}.

        \vdmarg{begx} and \vdmarg{begy} are relative to the screen, not to
        \vdmarg{origwin}.

  \item {\tt WINDOW *derwin(origwin, nlines, ncols, begy, begx)} \label{fun_derwin}\\
        The same as \vdmfunc{subwin(...)} except that \vdmarg{begx} and
        \vdmarg{begy} are relative to the window \vdmarg{origwin} than
        to the screen.

  \item {\tt int mvderwin(win, y, x)} \label{fun_mvderwin}\\
        Will move \vdmarg{win} inside its parent window.
        \noteni

  \item {\tt WINDOW *dupwin(win)} \label{fun_dupwin}\\
        Duplicate the window \vdmarg{win}.

  \item {\tt int syncok(win, bf)} \label{fun_syncok}\\
        {\tt void wsyncup(win)} \label{fun_wsyncup}\\
        {\tt void wcursyncup(win)} \label{fun_wcursyncup}\\
        {\tt void wsyncdown(win)} \label{fun_wsyncdown}\\
        \noteni

  \item {\tt int overlay(win1, win2)} \label{fun_overlay}\\
        {\tt int overwrite(win1, win2)} \label{fun_overwrite}\\
        \vdmfunc{overlay(...)} will copy all text from \vdmarg{win1} to 
        \vdmarg{win2} without copying blanks. \vdmfunc{overwrite(...)}
        does the same, but copies blanks, too.

  \item {\tt int copywin(win1, win2, sminrow, smincol, dminrow, dmincol,}\\
        {\tt dmaxrow, dmaxcol, overlay)} \label{fun_copywin}\\
        Similar to \vdmfunc{overlay(...)} and \vdmfunc{overwrite(...)}, but 
        provides control over what region of the window to copy.
\end{itemize}




\section{Output}

\begin{itemize}
  \item {\tt int addch(ch)} \label{fun_addch}\\
        {\tt int waddch(win, ch)} \label{fun_waddch}\\
        {\tt int mvaddch(y, x, ch)} \label{fun_mvaddch}\\
        {\tt int mvwaddch(win, y, x, ch)} \label{fun_mvwaddch}\\
	These functions are used for character output to a window. They
	will manipulate the window and you will have to call 
	\vdmfunc{refresh()} to put it on screen. \vdmfunc{addch(...)}
	and \vdmfunc{waddch(...)} put the character \vdmarg{ch} in the window
	\vdmscr{stdscr} or \vdmarg{win}. \vdmfunc{mvaddch(...)} and 
	\vdmfunc{mvwaddch(...)} do the same except that they move the cursor 
	to position y,x first.

  \item {\tt int addstr(str)} \label{fun_addstr}\\
        {\tt int addnstr(str, n)} \label{fun_addnstr}\\
        {\tt int waddstr(win, str)} \label{fun_waddstr}\\
        {\tt int waddnstr(win, str, n)} \label{fun_waddnstr}\\
        {\tt int mvaddstr(y, x, str)} \label{fun_mvaddstr}\\
        {\tt int mvaddnstr(y, x, str, n)} \label{fun_mvaddnstr}\\
        {\tt int mvwaddstr(win, y, x, str)} \label{fun_mvwaddstr}\\
        {\tt int mvwaddnstr(win, y, x, str, n)} \label{fun_mvwaddnstr}\\
        These functions write a string to a window and are equivalent to
        series of
        calls to \vdmfunc{addch(...)}. \vdmarg{str} is a null terminated string
        ({\it "blafoo\verb+\+0"}). Functions with {\it w} write the string
        \vdmarg{str} to the window \vdmarg{win}, while other funcions write to 
        \vdmscr{stdscr}.
        Functions with \vdmarg{n} write n characters of \vdmarg{str}. If 
        \vdmarg{n} is -1, the entire string \vdmarg{str} is written.

  \item {\tt int addchstr(chstr)} \label{fun_addchstr}\\
        {\tt int addchnstr(chstr, n)} \label{fun_addchnstr}\\
        {\tt int waddchstr(win, chstr)} \label{fun_waddchstr}\\
        {\tt int waddchnstr(win, chstr, n)} \label{fun_waddchnstr}\\
        {\tt int mvaddchstr(y, x, chstr)} \label{fun_mvaddchstr}\\
        {\tt int mvaddchnstr(y, x, chstr, n)} \label{fun_mvaddchnstr}\\
        {\tt int mvwaddchstr(win, y, x, chstr)} \label{fun_mvwaddchstr}\\
        {\tt int mvwaddchnstr(win, y, x, chstr, n)} \label{fun_mvwaddchnstr}\\
	These functions copy \vdmarg{chstr} to the window image
        (\vdmscr{stdscr} or \vdmarg{win}).  The starting position is the current
	cursor position.  Functions with \vdmarg{n} write n characters
	of \vdmarg{chstr}. If \vdmarg{n} is -1, the entire string 
	\vdmarg{chstr} is written. The cursor is not moved and no control
	character check is done. These functions are faster than the
        \vdmfunc{addstr(...)}
	routines. \vdmarg{chstr} is a pointer to an array of
	chtype.

  \item {\tt int echochar(ch)} \label{fun_echochar}\\
        {\tt int wechochar(win, ch)} \label{fun_wechochar}\\
        The same as call \vdmfunc{addch(...)} (\vdmfunc{waddch(...)} followed
        by \vdmfunc{refresh()} (\vdmfunc{wrefresh(win)}.
         
\end{itemize}




\subsection{Formatted Output}

\begin{itemize}
  \item {\tt int printw(fmt, ...)} \label{fun_printw}\\
        {\tt int wprintw(win, fmt, ...)} \label{fun_wprintw}\\
        {\tt int mvprintw(y, x, fmt, ...)} \label{fun_mvprintw}\\
        {\tt int mvwprintw(win, y, x, fmt, ...)} \label{fun_mvwprintw}\\
        {\tt int vwprintw(win, fmt, va\_list)} \label{fun_vwprintw}\\
        These functions correspond to \vdmfunc{printf(...)} and its counterparts
        from \vdmunix{libc}.

        In the \vdmunix{libc} package \vdmfunc{printf(...)} is used for 
        formatted output. You can define an output string and include
        variables of different types in it. See \secref{sec_formout} for more.

        For the use of \vdmfunc{vwprintw(...)} you have to include also
        \vdmunix{varargs.h}.
\end{itemize}




\subsection{Insert Characters/Lines}

\begin{itemize}
  \item {\tt int insch(c)} \label{fun_insch}\\
        {\tt int winsch(win, c)} \label{fun_winsch}\\
        {\tt int mvinsch(y,x,c)} \label{fun_mvinsch}\\
        {\tt int mvwinsch(win,y,x,c)} \label{fun_mvwinsch}\\
        Character \vdmarg{ch} is inserted to the left of the cursor and all
        characters are moved one position to the right. The character on 
        the right end of the line may be lost).

  \item {\tt int insertln()} \label{fun_insertln}\\
        {\tt int winsertln(win)} \label{fun_winsertln}\\
        Insert a blank line above the current one. (The bottom line will be 
        lost).

  \item {\tt int insdelln(n)} \label{fun_insdelln}\\
        {\tt int winsdelln(win, n)} \label{fun_winsdelln}\\
        For positive \vdmarg{n} these functions will insert n lines above
        the cursor in the appropriate window (so the n bottom lines will be
        lost). When \vdmarg{n} is negative,
        n lines under the cursor will be deleted and the rest will moved
        up.

  \item {\tt int insstr(str)} \label{fun_insstr}\\
        {\tt int insnstr(str, n)} \label{fun_insnstr}\\
        {\tt int winsstr(win, str)} \label{fun_winsstr}\\
        {\tt int winsnstr(win, str, n)} \label{fun_winsnstr}\\
        {\tt int mvinsstr(y, x, str)} \label{fun_mvinsstr}\\
        {\tt int mvinsnstr(y, x, str, n)} \label{fun_mvinsnstr}\\
        {\tt int mvwinsstr(win, y, x, str)} \label{fun_mvwinsstr}\\
        {\tt int mvwinsnstr(win, y, x, str, n)} \label{fun_mvwinsnstr}\\
        These functions will insert \vdmarg{str} in the current line left from
        the cursor (as many characters as fit to the line). The characters
        on the right of the cursor are moved right and will be lost when the
        end of the line is reached. The cursor position is not changed.

        \vdmarg{y} and \vdmarg{x} are the coordinates to which the cursor is 
        moved before \vdmarg{str} will be inserted, \vdmarg{n} is the number
        of characters to insert (with \vdmarg{n}=0 the entire string is 
        inserted).
\end{itemize}



\subsection{Delete Characters/Lines}

\begin{itemize}
  \item {\tt int delch()} \label{fun_delch}\\
        {\tt int wdelch(win)} \label{fun_wdelch}\\
        {\tt int mvdelch(y, x)} \label{fun_mvdelch}\\
        {\tt int mvwdelch(win, y, x)} \label{fun_mvwdelch}\\
        Delete the character under the cursor and move the remaining
        characters to the right of the cursor one position to the left.

        \vdmarg{y} and \vdmarg{x} are the coordinates to which the cursor will 
        be moved to before deleting.

  \item {\tt int deleteln()} \label{fun_deleteln}\\
        {\tt int wdeleteln(win)} \label{fun_wdeleteln}\\
        Delete the line under the cursor and move all other lines below one
        position up. Additionally, the bottom line of the window will be erased.
\end{itemize}




\subsection{Boxes and Lines}

\begin{itemize}
  \item {\tt int border(ls, rs, ts, bs, tl, tr, bl, br)} \label{fun_border}\\
        {\tt int wborder(win, ls, rs, ts, bs, tl, tr, bl, br)} \label{fun_wborder}\\
        {\tt int box(win, vert, hor)} \label{fun_box}\\
        Draw a border around the edges of a window (\vdmscr{stdscr} or 
        \vdmarg{win}). In the following table you see the characters
        and their default values when zero in a call to \vdmfunc{box(...)}.
        In the picture you can see the position from the characters in a box.

\begin{table}
  \caption{Ncurses - border characters}\label{tab_borderch}
  \begin{center}
    \begin{tabular}{c|l|l}
    {\bf Character} &  {\bf Position} &  {\bf Default} \\ \hline
    tl &  top left     &  ACS\_ULCORNER \\
    ts &  top side     &  ACS\_HLINE    \\
    tr &  top right    &  ACS\_URCORNER \\
    ls &  left side    &  ACS\_VLINE    \\
    rs &  right side   &  ACS\_VLINE    \\
    bl &  bottom left  &  ACS\_LLCORNER \\
    bs &  bottom side  &  ACS\_HLINE    \\
    br &  bottom right &  ACS\_LRCORNER \\
    rt &  right tee    &  ACS\_RTEE     \\
    lt &  left tee     &  ACS\_LTEE     \\
    tt &  top tee      &  ACS\_TTEE     \\
    bt &  bottom tee   &  ACS\_BTEE     \\
    \end{tabular}
  \end{center}
\end{table}

\begin{figure}
  \caption{Ncurses - box characters} \label{fig_boxbic}
  \begin{center}
    \input{boxpic.tex}
  \end{center}
\end{figure}

  \item {\tt int vline(ch, n)} \label{fun_vline}\\
        {\tt int wvline(win, ch, n)} \label{fun_wvline}\\
        {\tt int hline(ch, n)} \label{fun_hline}\\
        {\tt int whline(win, ch, n)} \label{fun_whline}\\
        These functions draw a vertical or horizontal line starting at the
        current cursor position. \vdmarg{ch} is the character to use and 
        \vdmarg{n} is the number of characters to draw. The cursor position 
        is not advanced.
\end{itemize}



\subsection{Background Character}

\begin{itemize}
  \item {\tt void bkgdset(ch)} \label{fun_bkgdset}\\
        {\tt void wbkgdset(win, ch)} \label{fun_wbkgdset}\\
        Set the background character and attribute for the screen or a window.
        The attribute in \vdmarg{ch} will be ORed with every non blank 
        character in the window. The background is then part of the window
        and will not be changed with scrolling and in- or output.

  \item {\tt int bkgd(ch)} \label{fun_bkgd}\\
        {\tt int wbkgd(win, ch)} \label{fun_wbkgd}\\
        Will change the background character and attribute to \vdmarg{ch}.
\end{itemize}
\section{Input}

\begin{itemize}
  \item {\tt int getch()} \label{fun_getch}\\
        {\tt int wgetch(win)} \label{fun_wgetch}\\
        {\tt int mvgetch(y, x)} \label{fun_mvgetch}\\
        {\tt int mvwgetch(win, y, x)} \label{fun_mvwgetch}\\
	\vdmfunc{getch()} will read input from the
	terminal in a manner depending on whether delay mode is set or
	not. If delay is on, \vdmfunc{getch()} will wait until a key is
	pressed, otherwise it will return the key in the input buffer
	or ERR if this buffer is empty. \vdmfunc{mvgetch(...)} and 
	\vdmfunc{mvwgetch(...)}
	will move the cursor to position \vdmarg{y,x}
	first.  The \vdmarg{w} functions read input from the terminal
	related to the window \vdmarg{win}, \vdmfunc{getch()} and 
	\vdmfunc{mvgetch(...)}
	from the terminal related to \vdmscr{stdscr}.

        With \vdmfunc{keypad(...)} enabled, \vdmfunc{getch()} will return a code defined in
        \vdmunix{ncurses.h} as KEY\_* macros when a function key is pressed. When
        ESCAPE is pressed (which can be the beginning of a function key)
        ncurses will start a one second timer.  If the remainder of
        the keystroke is not finished in this second, the key is returned.
        Otherwise, the function key value is returned.
        (If necessary, use \vdmfunc{notimeout()} to disable the second
        timer).

  \item {\tt int ungetch(ch)} \label{fun_ungetch}\\
        Will put the character \vdmarg{ch} back to the input buffer.

  \item {\tt int getstr(str)} \label{fun_getstr}\\
        {\tt int wgetstr(win, str)} \label{fun_wgetstr}\\
        {\tt int mvgetstr(y, x, str)} \label{fun_mvgetstr}\\
        {\tt int mvwgetstr(win, y, x, str)} \label{fun_mvwgetstr}\\
        {\tt int wgetnstr(win, str, n)} \label{fun_wgetnstr}\\
        These functions will do a series of calls to \vdmfunc{getch()}
        until a newline is
        received. The characters are placed in \vdmarg{str} (so don't forget to
        allocate memory for your character pointer before calling
        \vdmfunc{getstr(...)}). If echo is enabled the string is echoed (use
        \vdmfunc{noecho()} to disable echo) and the user's kill and delete
        characters will be interpreted.

  \item {\tt chtype inch()} \label{fun_inch}\\
        {\tt chtype winch(win)} \label{fun_winch}\\
        {\tt chtype mvinch(y, x)} \label{fun_mvinch}\\
        {\tt chtype mvwinch(win, y, x)} \label{fun_mvwinch}\\
        These functions return a character from the screen or window. Because
        the type of the return value is \vdmarg{chtype} attribute information
        is included. This information can be extracted from the character 
        using the A\_* constants (see \tabref{tab_attr}).

  \item {\tt int instr(str)} \label{fun_instr}\\
        {\tt int innstr(str, n)} \label{fun_innstr}\\
        {\tt int winstr(win, str)} \label{fun_winstr}\\
        {\tt int winnstr(win, str, n)} \label{fun_winnstr}\\
        {\tt int mvinstr(y, x, str)} \label{fun_mvinstr}\\
        {\tt int mvinnstr(y, x, str, n)} \label{fun_mvinnstr}\\
        {\tt int mvwinstr(win, y, x, str)} \label{fun_mvwinstr}\\
        {\tt int mvwinnstr(win, y, x, str, n)} \label{fun_mvwinnstr}\\
        Return a character string from the screen or a window.
        \noteni

  \item {\tt int inchstr(chstr)} \label{fun_inchstr}\\
        {\tt int inchnstr(chstr, n)} \label{fun_inchnstr}\\
        {\tt int winchstr(win, chstr)} \label{fun_winchstr}\\
        {\tt int winchnstr(win, chstr, n)} \label{fun_winchnstr}\\
        {\tt int mvinchstr(y, x, chstr)} \label{fun_mvinchstr}\\
        {\tt int mvinchnstr(y, x, chstr, n)} \label{fun_mvinchnstr}\\
        {\tt int mvwinchstr(win, y, x, chstr)} \label{fun_mvwinchstr}\\
        {\tt int mvwinchnstr(win, y, x, chstr, n)} \label{fun_mvwinchnstr}\\
        Return a chtype string from the screen or window. In the string,
        attribute information is included for every character.
        \notenie{lib\_inchstr not included in the ncurses lib}
\end{itemize}




\subsection{Formated Input}

\begin{itemize}
  \item {\tt int scanw(fmt, ...)} \label{fun_scanw}\\
        {\tt int wscanw(win, fmt, ...)} \label{fun_wscanw}\\
        {\tt int mvscanw(y, x, fmt, ...)} \label{fun_mvscanw}\\
        {\tt int mvwscanw(win, y, x, fmt, ...)} \label{fun_mvwscanw}\\
        {\tt int vwscanw(win, fmt, va\_list)} \label{fun_vwscanw}\\
        These are similar to \vdmfunc{scanf(...)} from \vdmunix{libc}(see
        \secref{sec_formin}). \vdmfunc{wgetstr(...)} is called
        and the results will be used as input for the scan.
\end{itemize}





\section{Options}


\subsubsection{Output Options}

\begin{itemize}
  \item {\tt int idlok(win, bf)} \label{fun_idlok}\\
        {\tt void idcok(win, bf)} \label{fun_idcok}\\
        Enable or disable terminal's insert/delete features for the window
        (\vdmfunc{idlok(...)} for lines and \vdmfunc{idcok(...)} for characters).
        \notenib{\vdmfunc{idcok(...)}}

  \item {\tt void immedok(win, bf)} \label{fun_immedok}\\
        If set TRUE, every change to the window \vdmarg{win} will cause a refresh
        to the physical screen. This can decrease the performance of a
        program, so the default value is FALSE.
        \noteni

  \item {\tt int clearok(win, bf)} \label{fun_clearok}\\
        If \vdmarg{bf} is TRUE the next call to \vdmfunc{wrefresh(win)} will clear the
        screen and redraw it completely. (as in the editor vi when you press
        CTRL+L).

  \item {\tt int leaveok(win, bf)} \label{fun_leaveok}\\
        The default behavior is for ncurses to leave the physical cursor in the
        same place it was on the last refresh of the window.
        Programs which don't use the cursor
        can set \vdmfunc{leaveok(...)} TRUE and save the time normally required for
        cursor motion. In addition, ncurses will try to make the terminal 
        cursor invisible.

  \item {\tt int nl()} \label{fun_nl}\\
        {\tt int nonl()} \label{fun_nonl}\\
        Control the translation for newline. Turned on with \vdmfunc{nl()} will
        translate a newline in carriage return and line feed on output.
        \vdmfunc{nonl()} will turn translation off. With disabled translation
        ncurses can do faster cursor motion.
\end{itemize}




\subsection{Input Options}

\begin{itemize}
  \item {\tt int keypad(win, bf)} \label{fun_keypad}\\
        If TRUE, it enables the keypad on the keyboard of the user's terminal 
        when
        waiting for input. Ncurses will then return a key code defined in
        \vdmunix{ncurses.h} as KEY\_* for the function and arrow keys on the keypad.
        This is very useful for a PC keyboard because you can enable the
        numerical block and the cursor keys.
        \begin{figure}
%          \caption{} \label{}
          \begin{center}
            \input{keypad.tex}
          \end{center}
        \end{figure}

  \item {\tt int meta(win, bf)} \label{fun_meta}\\
        If TRUE, the key codes returned from \vdmfunc{getch()} are 8-bit-clean
        (the highest bit will not be stripped).

  \item {\tt int cbreak()} \label{fun_cbreak}\\
        {\tt int nocbreak()} \label{fun_nocbreak}\\
        {\tt int crmode()} \label{fun_crmode}\\
        {\tt int nocrmode()} \label{fun_nocrmode}\\
        \vdmfunc{cbreak()} and \vdmfunc{nocbreak()} will turn the terminal CBREAK mode
        on or off. When CBREAK is on, input from a read will be immediately
        available to the program, when off the input will be buffered until
        newline occurs. 
        \notenm{\vdmfunc{crmode()} and \vdmfunc{nocrmode()} are for upward compatibility,
        don't use them}

  \item {\tt int raw()} \label{fun_raw}\\
        {\tt int noraw()} \label{fun_noraw}\\
        Turn RAW mode on or off. RAW is the same as CBREAK, except that in RAW
        mode no special character processing will be done.

  \item {\tt int echo()} \label{fun_echo}\\
        {\tt int noecho()} \label{fun_noecho}\\
        Set \vdmfunc{echo()} to echo input typed by the user and \vdmfunc{noecho()}
        to be silent about it.

  \item {\tt int halfdelay(t)} \label{fun_halfdelay}\\
        As \vdmfunc{cbreak()} with a delay of \vdmarg{t} seconds.

  \item {\tt int nodelay(win, bf)} \label{fun_nodelay}\\
        Terminal will be set to no blocking mode. \vdmfunc{cetch()} will return ERR
        if no input is ready. If set to FALSE, \vdmfunc{getch()} will wait until a
        key is pressed.

  \item {\tt int timeout(t)} \label{fun_timeout}\\
        {\tt int wtimeout(win, t)} \label{fun_wtimeout}\\
        It is recommended to use these functions instead of
        \vdmfunc{halfdelay(t)} and \vdmfunc{nodelay(win,bf)}. The result of
        \vdmfunc{getch()}
        depends on the value of \vdmarg{t}. If \vdmarg{t} is positive, the read 
        is blocked for \vdmarg{t} milliseconds, if \vdmarg{t} is zero, no
        blocking is done, and when \vdmarg{t} is negative the program blocks
        until input is available.

  \item {\tt int notimeout(win, bf)} \label{fun_notimeout}\\
        If \vdmarg{bf} is TRUE, \vdmfunc{getch()} will use a special timer (of one second
        length)
        to interpret and input sequence beginning with keys as ESCAPE etc.

  \item {\tt int typeahead(fd)} \label{fun_typeahead}\\
        If \vdmarg{fd} is -1 no typeahead check will be done, else ncurses will
        use the file descriptor \vdmarg{fd} instead of \vdmunix{stdin} for these
        checks.

  \item {\tt int intrflush(win, bf)} \label{fun_intrflush}\\
        When enabled with \vdmarg{bf} TRUE an interrupt key pressed on the
        terminal (quit, break ...) will flush all output in the tty driver
        queue.

  \item {\tt void noqiflush()} \label{fun_noqiflush}\\
        {\tt void qiflush()} \label{fun_qiflush}\\
        \noteni
\end{itemize}




\subsection{Terminal Attributes}

\begin{itemize}
  \item {\tt int baudrate()} \label{fun_baudrate}\\
        Returns the terminal speed in bps.

  \item {\tt char erasechar()} \label{fun_erasechar}\\
        Returns the current erase character.

  \item {\tt char killchar()} \label{fun_killchar}\\
        Returns the current kill character.

  \item {\tt int has\_ic()} \label{fun_has_ic}\\
        {\tt int has\_il()} \label{fun_has_il}\\
        \vdmfunc{has\_ic()} returns TRUE if the terminal has insert/delete
        character
        capability, \vdmfunc{has\_il()} returns TRUE when the terminal has
        insert/delete line capability. Otherwise the functions return ERR.
        \noteni

  \item {\tt char *longname()} \label{fun_longname}\\
        The returned pointer gives access to the description of the current
        terminal.

  \item {\tt chtype termattrs()} \label{fun_termattrs}\\
        \noteni

  \item {\tt char *termname()} \label{fun_termname}\\
        Returns the contents of TERM from the users environment.
        \noteni
\end{itemize}




\subsection{Use Options}

Now we have seen the window options and terminal modes it is time to
describe their use.

First, on Linux you should enable the keypad. This will allow
use of the cursor keys and the numeric block on the PC keyboard.

\begin{tscreen}
\begin{verbatim}
    keypad(stdscr,TRUE);
\end{verbatim}
\end{tscreen}

Now, there are two main types of input.

\begin{enumerate}
  \item The program wants the user to enter a
        key and then will call a function depend
        on this key. (For example, something like "press 'q' for quit" and wait
        for {\it q})
  \item The program wants a string of characters typed by the user in a mask
        on the screen.  For example: a directory or an address in a database.
\end{enumerate}

For the first we use the following options and modes and the while loop will
work correctly.

\begin{tscreen}
\begin{verbatim}
    char c;

    noecho();
    timeout(-1);
    nonl();
    cbreak();
    keypad(stdscr,TRUE);
    while(c=getch()){
      switch(c){
        case 'q': your_quit_function();
        default:  break;
      }
   }
\end{verbatim}
\end{tscreen}

The program will hang until a key is pressed. If the key was
{\it q} we call our quit function else we wait for other input.

The switch statement can be expanded until we have an input function that
fits our wishes. Use the KEY\_* macros to check special keys, for instance

\begin{tscreen}
\begin{verbatim}
    KEY_UP      KEY_RIGHT    KEY_A1    KEY_B2    KEY_C1
    KEY_DOWN    KEY_LEFT     KEY_A3              KEY_C3
\end{verbatim}
\end{tscreen}

for the cursor keys on the keyboard.
For a file viewer the loop can look like this:

\begin{tscreen}
\begin{verbatim}
    int loop=TRUE;
    char c;
    enum{UP,DOWN,RIGHT,LEFT};

    noecho();
    timeout(-1);
    nonl();
    cbreak();
    keypad(stdscr,TRUE);
    while(loop==TRUE){
      c=getch();
      switch(c){
        case KEY_UP:
        case 'u':
        case 'U': scroll_s(UP);
                  break;
        case KEY_DOWN:
        case 'd':
        case 'D': scroll_s(DOWN);
                  break;
        case KEY_LEFT:
        case 'l':
        case 'L': scroll_s(LEFT);
                  break;
        case KEY_RIGHT
        case 'r':
        case 'R': scroll_s(RIGHT);
                  break;
        case 'q':
        case 'Q': loop=FALSE;
        default:  break;
      }
   }
\end{verbatim}
\end{tscreen}

For the second, we only need to set \vdmfunc{echo()} and the characters typed
by the user will be printed to the screen. To have the characters printed
on the position you want, use \vdmfunc{move(...)} or \vdmfunc{wmove(...)}.

Or, we could open a window with a mask in it
(some other colors than those of the window
will do this) and ask the user to input a string:

\begin{tscreen}
\begin{verbatim}
    WINDOW *maskwin;
    WINDOW *mainwin;
    char *ptr=(char *)malloc(255);
    ...
      mainwin=newwin(3,37,9,21);
      maskwin=newwin(1,21,10,35);
      ...
      werase(mainwin);
      werase(maskwin);
      ...
      box(mainwin,0,0);
      mvwaddstr(mainwin,1,2,"Inputstring: ");
      ...
      wnoutrefresh(mainwin);
      wnoutrefresh(maskwin);
      doupdate();
      ...
      mvwgetstr(maskwin,0,0,ptr);
      ...
      delwin(maskwin);
      delwin(mainwin);
      endwin();
      free(ptr);
\end{verbatim}
\end{tscreen}
    
See \vdmunix{input.c} in the example directory for more explanation.




\section{Clear Window and Lines}

\begin{itemize}
  \item {\tt int erase()} \label{fun_erase}\\
        {\tt int werase(win)} \label{fun_werase}\\
        \vdmfunc{werase(...)} and \vdmfunc{erase()} will copy blanks to every position
        on the window \vdmarg{win} or \vdmscr{stdscr}. For instance, when you set
        color attributes to a window and call \vdmfunc{werase()} the window would be
        colored. I had some problems with COLOR\_PAIRS when I defined other
        attributes then black on white so I wrote my own erase function (this is
        a low level access to the WINDOW structure):

\begin{tscreen}
\begin{verbatim}
    void NewClear(WINDOW *win)
    {
    int  y,x;

     for ( y = 0 ; y <= win -> _maxy ; y++ )
       for ( x = 0 ; x <= win -> _maxx ; x++ )
         (chtype *) win-> _line[y][x] = ' '|win-> _attrs;
     win -> _curx = win -> _cury = 0;
     touchwin(win);
    }
\end{verbatim}
\end{tscreen}

        The problem is, that ncurses sometimes makes no use of the window 
        attributes when
        blanking the screen. For instance, in \vdmunix{lib\_clrtoeol.c}, is 
        BLANK defined as
\begin{tscreen}
\begin{verbatim}
    #define BLANK ' '|A_NORMAL
\end{verbatim}
\end{tscreen}
        so that the other window attributes get lost while the line is 
        erased. 

  \item {\tt int clear()} \label{fun_clear}\\
        {\tt int wclear(win)} \label{fun_wclear}\\
        The same as \vdmfunc{erase()}, but will also set \vdmfunc{clearok()} (the screen
        will be cleared with the next refresh).

  \item {\tt int clrtobot()} \label{fun_clrtobot}\\
        {\tt int wclrtobot(win)} \label{fun_wclrtobot}\\
        Clearing the current cursor line (start is one character right from the
        cursor) and the line below the cursor.

  \item {\tt int clrtoeol()} \label{fun_clrtoeol}\\
        {\tt int wclrtoeol(win)} \label{fun_wclrtoeol}\\
        Clear the current line right from the cursor up to its end.
\end{itemize}




\section{Updating the Terminal}

As written in the overview, ncurses windows are images in memory. This
means that any change to a window is not printed to the physical screen until
a refresh is done.  This optimizes the output to the screen because you
can do a lot of manipulations and then, once, call refresh to print it
to screen.  Otherwise, every change would be printed to the terminal and
decrease the performance of your programs.

\begin{itemize}
  \item {\tt int refresh()} \label{fun_refresh}\\
        {\tt int wrefresh(win)} \label{fun_wrefresh}\\
        \vdmfunc{refresh()} copies \vdmscr{stdscr} to the terminal and
        \vdmfunc{wrefresh(win)} copies the window image to \vdmscr{stdscr} and 
        then makes
        \vdmscr{curscr} looks like \vdmscr{stdscr}.

  \item {\tt int wnoutrefresh(win)} \label{fun_wnoutrefresh}\\
        {\tt int doupdate()} \label{fun_doupdate}\\
        \vdmfunc{wnoutrefresh(win)} copies the window \vdmarg{win} to \vdmscr{stdscr} only.
        This means that no output to the terminal is done but the virtual
        screen \vdmscr{stdscr} actually looks like the programmer wanted.
        \vdmfunc{doupdate()} will do the output to the terminal. A program can
        change various windows, call \vdmfunc{wnoutrefresh(win)} for every window
        and then call \vdmfunc{doupdate()} to update the physical screen only once.

        For instance, we have the following program with two windows.
        We change both windows by altering some lines of text.
        We can write {\it changewin(win)} with \vdmfunc{wrefresh(win)}.

\begin{tscreen}
\begin{verbatim}
    main()                    changewin(WINDOW *win)
    {                         {
    WINDOW *win1,*win2;           ... /* here we change */
        ...                       ... /* the lines */
        changewin(win1);          wrefresh(win);
        changewin(win2);      return;
        ...                   }
    }
\end{verbatim}
\end{tscreen}

        This will cause ncurses to update the terminal twice and slow down our
        execution. With \vdmfunc{doupdate()} we change {\it changewin(win)} and
        our main function and will get better a performance.

\begin{tscreen}
\begin{verbatim}
    main()                    changewin(WINDOW *win)
    {                         {
    WINDOW *win1,*win2;           ... /* here we change */
        ...                       ... /* the lines */
        changewin(win1);          wnoutrefresh(win);
        changewin(win2);      return;
        doupdate();           }
        ...
    }
\end{verbatim}
\end{tscreen}

  \item {\tt int redrawwin(win)} \label{fun_redrawwin}\\
        {\tt int wredrawln(win, bline, nlines)} \label{fun_wredrawln}\\
        Use these functions when some lines or the entire screen should
        thrown away before writing anything new in it (may be when the
        lines are trashed or so).

  \item {\tt int touchwin(win)} \label{fun_touchwin}\\
        {\tt int touchline(win, start, count)} \label{fun_touchline}\\
        {\tt int wtouchln(win, y, n, changed)} \label{fun_wtouchln}\\
        {\tt int untouchwin(win)} \label{fun_untouchwin}\\
        Tells ncurses that the whole window \vdmarg{win} or the lines from
        \vdmarg{start} up to \vdmarg{start+count}
        have been manipulated. For instance, when you have some overlapping
        windows (as in the example \vdmunix{type.c}) a change to one
        window will not affect the image from the other.

        \vdmfunc{wtouchln(...)} will touch \vdmarg{n} lines starting at \vdmarg{y}.
        If \vdmarg{change} is TRUE the lines are touched, otherwise untouched
        (changed or unchanged).

        \vdmfunc{untouchwin(win)} will mark the window \vdmarg{win} as unchanged
        since the last call to \vdmfunc{refresh()}.

  \item {\tt int is\_linetouched(win, line)} \label{fun_is_linetouched}\\
        {\tt int is\_wintouched(win)} \label{fun_is_wintouched}\\
        With these functions you can check if the line \vdmarg{line} or the
        window \vdmarg{win} has been touched since the last call to
        \vdmfunc{refresh()}.
\end{itemize}




\section{Video Attributes and Color}

Attributes are special terminal capabilities used when printing characters
to the screen.  Characters can be printed bold, underlined, blinking, etc.
In ncurses you have the ability to turn attributes on or off to get
better looking output. Possible attributes are listed in the following table.

\begin{table}
  \caption{Ncurses - attributes}\label{tab_attr}
  \begin{center}
    \begin{tabular}{l|l}
    {\bf Definition} &  {\bf Attribute} \\ \hline
    A\_ATTRIBUTES    &  mask for attributes (chtype) \\
    A\_NORMAL        &  normal, reset all other \\
    A\_STANDOUT      &  best highlighting mode \\
    A\_UNDERLINE     &  underline \\
    A\_REVERSE       &  reverse video \\
    A\_BLINK         &  blinking \\
    A\_DIM           &  dim or half bright \\
    A\_BOLD          &  bold or extra bright \\
    A\_ALTCHARSET    &  use alternate character set \\
    A\_INVIS         &  invisible \\
    A\_PROTECT       &  ??? \\
    A\_CHARTEXT      &  mask for actual character (chtype) \\
    A\_COLOR         &  mask for color \\
    COLOR\_PAIR(n)   &  set color-pair to that stored in n \\
    PAIR\_NUMBER(a)  &  get color-pair stored in attribute a \\
    \end{tabular}
  \end{center}
 \end{table}

Ncurses defines eight colors you can use on a terminal with color support.
First, initialize the color data structures with \vdmfunc{start\_color()}, then
check the terminal capabilities with \vdmfunc{has\_colors()}.
\vdmfunc{start\_color()} will initialize {\it COLORS}, the maximum colors
the terminal supports, and {\it COLOR\_PAIR}, the maximum number of color
pairs you can define.

\begin{table} 
  \caption{Ncurses - colors} \label{tab_color}
  \begin{center}
    \begin{tabular}{l|l}
    {\bf Definition} &  {\bf Color} \\ \hline
    COLOR\_BLACK &  black \\
    COLOR\_RED &  red \\
    COLOR\_GREEN &  green \\
    COLOR\_YELLOW &  yellow \\
    COLOR\_BLUE &  blue \\
    COLOR\_MAGENTA &  magenta \\
    COLOR\_CYAN &  cyan \\
    COLOR\_WHITE &  white \\
    \end{tabular}
  \end{center}
\end{table}

The attributes can be combined with the OR operator
'${\verbar}$' so that you can
produce bold blinking output with

\begin{tscreen}
\begin{verbatim}
    A_BOLD|A_BLINK
\end{verbatim}
\end{tscreen}

When you set a window to attribute \vdmarg{attr}, all characters printed to this
window will get this property until you change the window attribute.
It will not get lost when you scroll or move the window or anything else.

When you write programs for ncurses and BSD curses be careful with colors
because BSD curses has no color support.  (Also, old SYS V versions of curses
do not have color support). So you have to use \vdmunix{\#ifdef} operations when
you compile for both libraries.


\begin{itemize}
  \item {\tt int attroff(attr)} \label{fun_attroff}\\
        {\tt int wattroff(win, attr)} \label{fun_wattroff}\\
        {\tt int attron(attr)} \label{fun_attron}\\
        {\tt int wattron(win, attr)} \label{fun_wattron}\\
        Turn on or off the specified attribute \vdmarg{attr} without reflecting the
        other attributes in a window (\vdmscr{stdscr} or \vdmarg{win}).

  \item {\tt int attrset(attr)} \label{fun_attrset}\\
        {\tt int wattrset(win, attr)} \label{fun_wattrset}\\
        Set the attribute on \vdmscr{stdscr} or \vdmarg{win} to \vdmarg{attr}.

  \item {\tt int standout()} \label{fun_standout}\\
        {\tt int standend()} \label{fun_standend}\\
        {\tt int wstandout(win)} \label{fun_wstandout}\\
        {\tt int wstandend(win)} \label{fun_wstandend}\\
        Turn on standout attribute for the window (\vdmscr{stdscr} or
        \vdmarg{win}).

  \item {\tt chtype getattrs(win)} \label{fun_getattrs}\\
        Return the current attributes for window \vdmarg{win}.

  \item {\tt bool has\_colors()} \label{fun_has_colors}\\
        Returns TRUE if the terminal has colors. Before you use
        colors check the terminal with \vdmfunc{has\_colors()}, and before this
        initialize colors with \vdmfunc{start\_color())}.

  \item {\tt bool can\_change\_color()} \label{fun_can_change_color}\\
        TRUE if the terminal can redefine colors.

  \item {\tt int start\_color()} \label{fun_start_color}\\
        Color initializing. This function has to be called before using colors!

  \item {\tt int init\_pair(pair, fg, bg)} \label{fun_init_pair}\\
        When you use colors as attributes for windows you have first to
        define a color pair with \vdmfunc{init\_pair(...)}. \vdmarg{fg} is the foreground
        color and \vdmarg{bg} the background color for \vdmarg{pair}.
        This is a value from 1 to $COLOR\hspace{.167em}PAIRS-1$
        (No fault, but 0 is reserved for black on white). Once
        defined you can use \vdmarg{pair} like an attribute. For instance when you
        want to have red characters on a blue screen do:

\begin{tscreen}
\begin{verbatim}
    init_pair(1,COLOR_RED,COLOR_BLUE);
\end{verbatim}
\end{tscreen}

        Now use \vdmfunc{wattr(...)} to set \vdmarg{win} to our new color pair:

\begin{tscreen}
\begin{verbatim}
    wattr(win,COLOR_PAIR(1));
\end{verbatim}
\end{tscreen}

       Or, combine color pairs with other attributes, such as:

\begin{tscreen}
\begin{verbatim}
    wattr(win ,A_BOLD|COLOR_PAIR(1));
    wattr(win1,A_STANDOUT|COLOR_PAIR(1));
\end{verbatim}
\end{tscreen}

        The first will invoke the color pair and set the attribute BOLD and
        the second will turn on standout mode, so that you get highlighted red
        on a blue screen.

  \item {\tt int pair\_content(pair, f, b)} \label{fun_pair_content}\\
        Will return the foreground and background color from
        \vdmarg{pair}.

  \item {\tt int init\_color(color, r, g, b)} \label{fun_init_color}\\
        Change the color components \vdmarg{r}, \vdmarg{g} and \vdmarg{b} for
        \vdmarg{color}. \vdmarg{r}, \vdmarg{g} and \vdmarg{b} can have values from 1 to
        $COLORS-1$.

  \item {\tt int color\_content(color, r, g, b)} \label{fun_color_content}\\
        Get the color components \vdmarg{r}, \vdmarg{g} and \vdmarg{b} for
        \vdmarg{color}.
\end{itemize}

And how to combine attributes and colors? Some terminals, as the console
in Linux, have colors and some not (xterm, vs100 etc). The following
code should solve the problem:

\begin{tscreen}
\begin{verbatim}
void CheckColor(WINDOW *win1, WINDOW *win2)
{
 start_color();
 if (has_colors()){
   /* fine, we have colors, define color_pairs for foreground
    * and background colors
    */
   init_pair(1,COLOR_BLUE,COLOR_WHITE);
   init_pair(2,COLOR_WHITE,COLOR_RED);
   /* now use the defined color_pairs for the windows */
   wattrset(win1,COLOR_PAIR(2));
   wattrset(win2,COLOR_PAIR(1));
 }
 else{
   /* Ohh, no color (maybe a vt100 or xterm). OK, we'll
    * use black/white attributes instead.
    */
   wattrset(win1,A_REVERSE);
   wattrset(win2,A_BOLD);
 }
return;
}
\end{verbatim}
\end{tscreen}

First, the function {\it CheckColor} initializes the colors with
\vdmfunc{start\_color()}, then the function \vdmfunc{has\_colors()}
will return TRUE if the current terminal has colors.
We check this and call \vdmfunc{init\_pair(...)} to combine foreground and
background colors and \vdmfunc{wattrset(...)} to set these pairs for the
specified window.  Alternatively, we can use \vdmfunc{wattrset(...)}
alone to set attributes if we have a black and white terminal.

To get colors in an xterm the best way I found out is to use the
ansi\_xterm with the patched terminfo entries from the Midnight Commander.
Just get the sources of ansi\_xterm and Midnight Commander (mc-x.x.tar.gz).
Then compile the ansi\_xterm and use tic with xterm.ti and vt100.ti from
the mc-x.x.tar.gz archive. Execute ansi\_xterm and test it out.




\section{Cursor and Window Coordinates}

\begin{itemize}
  \item {\tt int move(y, x)} \label{fun_move}\\
        {\tt int wmove(win, y, x)} \label{fun_wmove}\\
        \vdmfunc{move()} moves the cursor from \vdmscr{stdscr}, \vdmfunc{wmove(win)} the
        cursor from window \vdmarg{win}. For input/output functions,
        additional macros are
        defined which move the cursor before the specified function is called.

  \item {\tt int curs\_set(bf)} \label{fun_curs_set}\\
        This will turn the cursor visibility on or off, if the terminal has
        this capability.

  \item {\tt void getyx(win, y, x)} \label{fun_getyx}\\
        \vdmfunc{getyx(...)} will return the current cursor position.
        \notenm{this is a macro}

  \item {\tt void getparyx(win, y, x)} \label{fun_getparyx}\\
        When \vdmarg{win} is a sub window, \vdmfunc{getparyx(...)} will store the
        window coordinates relative to the parent window in \vdmarg{y} and
        \vdmarg{x}. Otherwise \vdmarg{y} and \vdmarg{x} are -1.
        \noteni
  
  \item {\tt void getbegyx(win, y, x)} \label{fun_getbegyx}\\
        {\tt void getmaxyx(win, y, x)} \label{fun_getmaxyx}\\
        {\tt int getmaxx(win)} \label{fun_getmaxx}\\
        {\tt int getmaxy(win)} \label{fun_getmaxy}\\
        Store the begin and size coordinates for \vdmarg{win} in \vdmarg{y} and
        \vdmarg{x}.

  \item {\tt int getsyx(int y, int x)} \label{fun_getsyx}\\
        {\tt int setsyx(int y, int x)} \label{fun_setsyx}\\
        Store the virtual screen cursor in \vdmarg{y} and \vdmarg{x} or set this
        cursor. When \vdmarg{y} and \vdmarg{x} are -1 and you call \vdmfunc{getsyx(...)}
        {\it leaveok} will be set.
\end{itemize}





\section{Scrolling}

\begin{itemize}
  \item {\tt int scrollok(win, bf)} \label{fun_scrollok}\\
        If TRUE, the text in the window \vdmarg{win} will be scrolled up one line
        when the cursor is on the lower right corner and a character is typed
        (or newline). If FALSE, the cursor is left in the same position.

        When turned on the contents of a window
        can be scrolled with the following functions. 
        \notenm{It would be also
        scrolled, if you print a new line in the last line of the window. So, be
        careful with \vdmfunc{scrollok(...)} or you will get unreasonable results}

  \item {\tt int scroll(win)} \label{fun_scroll}\\
        This function will scroll up the window (and the lines in the data
        structure) one line.

  \item {\tt int scrl(n)} \label{fun_scrl}\\
        {\tt int wscrl(win, n)} \label{fun_wscrl}\\
        These functions will scroll the window \vdmscr{stdscr} or \vdmarg{win} up or
        down depending on the value of the integer \vdmarg{n}. If \vdmarg{n} is
        positive the window will be scrolled up \vdmarg{n} lines, otherwise if
        \vdmarg{n} is negative the window will be scrolled down \vdmarg{n} lines.

  \item {\tt int setscrreg(t, b)} \label{fun_setscrreg}\\
        {\tt int wsetscrreg(win, t, b)} \label{fun_wsetscrreg}\\
        Set a software scrolling region.
\end{itemize}

The following code should explain how to get the effect of scrolling a text 
on the screen. Look also in \vdmunix{type.c} in the example directory.

We have a window with 18 lines and 66 columns and want to scroll a text
in it. {\it S$[]$} is a character array with the text. {\it Max\_s} is the
number of the last line in {\it s$[]$}. {\it Clear\_line} will print blank
characters from the current cursor position up to the end of the line
using the current attributes from the window (not A\_NORMAL as clrtoeol
does). {\it Beg} is the last line from {\it s$[]$} currently shown on the
screen. {\it Scroll} is an enumerate to tell the function what to do, show
the NEXT or PREVious line from the text.

\begin{tscreen}
\begin{verbatim}
enum{PREV,NEXT)};

void scroll_s(WINDOW *win, int scroll)
{
 /* test if we should scroll down and if there is
  * anything to scroll down
  */
 if((scroll==NEXT)&&(beg<=(max_s-18))){
 /* one line down */
     beg++;
 /* give permissions to scroll */
     scrollok(win, TRUE);
 /* scroll */
     wscrl(win, +1);
 /* deny permission to scroll */
     scrollok(win, FALSE);
 /* set the new string in the last line */
     mvwaddnstr(win,17,0,s[beg+17],66);
 /* clear the last line from the last character up to end
  * of line. Otherwise the attributes will be garbaged.
  */
     clear_line(66,win);
 }
 else if((scroll==PREV)&&(beg>0)){
     beg--;
     scrollok(win, TRUE);
     wscrl(win, -1);
     scrollok(win, FALSE);
     mvwaddnstr(win,0,0,s[beg],66);
     clear_line(66,win);
 }
 wrefresh(win);
return;
}

\end{verbatim}
\end{tscreen}




\section{Pads}

\begin{itemize}
  \item {\tt WINDOW *newpad(nlines, ncols)} \label{fun_newpad}\\
  \item {\tt WINDOW *subpad(orig, nlines, ncols,  begy, begx)} \label{fun_subpad}\\
  \item {\tt int prefresh(pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)} \label{fun_prefresh}\\
  \item {\tt int pnoutrefresh(pad, pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol)} \label{fun_pnoutrefresh}\\
  \item {\tt int pechochar(pad, ch)} \label{fun_pechochar}\\
\end{itemize}




\section{Soft-labels}

\begin{itemize}
  \item {\tt int slk\_init(int fmt)} \label{fun_slk_init}\\
  \item {\tt int slk\_set(int labnum, char *label, int fmt)} \label{fun_slk_set}\\
  \item {\tt int slk\_refresh()} \label{fun_slk_refresh}\\
  \item {\tt int slk\_noutrefresh()} \label{fun_slk_noutrefresh}\\
  \item {\tt char *slk\_label(int labnum)} \label{fun_slk_label}\\
  \item {\tt int slk\_clear()} \label{fun_slk_clear}\\
  \item {\tt int slk\_restore()} \label{fun_slk_restore}\\
  \item {\tt int slk\_touch()} \label{fun_slk_touch}\\

  \item {\tt int slk\_attron(chtype attr)} \label{fun_slk_attron}\\
        {\tt int slk\_attrset(chtype attr)} \label{fun_slk_attrset}\\
        {\tt int slk\_attroff(chtype attr)} \label{fun_slk_attroff}\\
        These functions correspond to \vdmfunc{attron(attr)},
        \vdmfunc{attrset(attr)} and \vdmfunc{attroff(attr)}. Not implemented
        yet.
\end{itemize}




\section{Miscellaneous}

\begin{itemize}
  \item {\tt int beep()} \label{fun_beep}\\
  \item {\tt int flash()} \label{fun_flash}\\
  \item {\tt char *unctrl(chtype c)} \label{fun_unctrl}\\
  \item {\tt char *keyname(int c)} \label{fun_keyname}\\
  \item {\tt int filter()} \label{fun_filter}\\
        \noteni
  \item {\tt void use\_env(bf)} \label{fun_use_env}\\
  \item {\tt int putwin(WINDOW *win, FILE *filep)} \label{fun_putwin}\\
        \noteni
  \item {\tt WINDOW *getwin(FILE *filep)} \label{fun_getwin}\\
        \noteni
  \item {\tt int delay\_output(int ms)} \label{fun_delay_output}\\
  \item {\tt int flushinp()} \label{fun_flushinp}\\
\end{itemize}




\section{Low-level Access}

\begin{itemize}
  \item {\tt int def\_prog\_mode()} \label{fun_def_prog_mode}\\    % == saveterm()
  \item {\tt int def\_shell\_mode()} \label{fun_def_shell_mode}\\
  \item {\tt int reset\_prog\_mode()} \label{fun_reset_prog_mode}\\  % == fixterm()
  \item {\tt int reset\_shell\_mode()} \label{fun_reset_shell_mode}\\ % == resetterm()
  \item {\tt int resetty()} \label{fun_resetty}\\
  \item {\tt int savetty()} \label{fun_savetty}\\
  \item {\tt int ripoffline(int line, int (*init)(WINDOW *, int))} \label{fun_ripoffline}\\
  \item {\tt int napms(int ms)} \label{fun_napms}\\
\end{itemize}




\section{Screen Dump}

\begin{itemize}
  \item {\tt int scr\_dump(char *filename)} \label{fun_scr_dump}\\
        \noteni
  \item {\tt int scr\_restore(char *filename)} \label{fun_scr_restore}\\
        \noteni
  \item {\tt int scr\_init(char *filename)} \label{fun_scr_init}\\
        \noteni
  \item {\tt int scr\_set(char *filename)} \label{fun_scr_set}\\
        \noteni
\end{itemize}




\section{Termcap Emulation}

\begin{itemize}
  \item {\tt int tgetent(char *bp, char *name)} \label{fun_nc_tgetent}\\
  \item {\tt int tgetflag(char id[2])} \label{fun_nc_tgetflag}\\
  \item {\tt int tgetnum(char id[2])} \label{fun_nc_tgetnum}\\
  \item {\tt char *tgetstr(char id[2], char **area)} \label{fun_nc_tgetstr}\\
  \item {\tt char *tgoto(char *cap, int col, int row)} \label{fun_tgoto}\\
  \item {\tt int tputs(char *str, int affcnt, int (*putc)())} \label{fun_nc_tputs}\\
\end{itemize}




\section{Terminfo Functions}

\begin{itemize}
  \item {\tt int setupterm(char *term, int fildes, int *errret)} \label{fun_setupterm}\\
  \item {\tt int setterm(char *term)} \label{fun_setterm}\\
  \item {\tt int set\_curterm(TERMINAL *nterm)} \label{fun_set_curterm}\\
  \item {\tt int del\_curterm(TERMINAL *oterm)} \label{fun_del_curterm}\\
  \item {\tt int restartterm(char *term, int fildes, int *errret)} \label{fun_restartterm}\\
        \noteni
        
  \item {\tt char *tparm(char *str, p1, p2, p3, p4, p5, p6, p7, p8, p9)} \label{fun_tparm}\\
        p1 - p9 long int.
  \item {\tt int tputs(char *str, int affcnt, int (*putc)(char))} \label{fun_tputs}\\
  \item {\tt int putp(char *str)} \label{fun_putp}\\
  \item {\tt int vidputs(chtype attr, int (*putc)(char))} \label{fun_vidputs}\\
  \item {\tt int vidattr(chtype attr)} \label{fun_vidattr}\\
  \item {\tt int mvcur(int oldrow, int oldcol, int newrow, int newcol)} \label{fun_mvcur}\\
  \item {\tt int tigetflag(char *capname)} \label{fun_tigetflag}\\
  \item {\tt int tigetnum(char *capname)} \label{fun_tigetnum}\\
  \item {\tt int tigetstr(char *capname)} \label{fun_tigetstr}\\
\end{itemize}




\section{Debug Function}

\begin{itemize}
  \item {\tt void \_init\_trace()} \label{fun__init_trace}\\
  \item {\tt void \_tracef(char *, ...)} \label{fun__tracef}\\
  \item {\tt char *\_traceattr(mode)} \label{fun__traceattr}\\
  \item {\tt void traceon()} \label{fun_traceon}\\
  \item {\tt void traceoff()} \label{fun_traceoff}\\
\end{itemize}




\section{Terminfo Capabilities}

\subsection{Boolean Capabilities}
\begin{small}
\begin{tabbing}
1234567890123456789012\=3456123\=45678\=901234567890\kill
{\bf Variable} \> {\bf Cap.} \> {\bf Int.}  \> {\bf Description}\\
               \> {\bf Name} \> {\bf Code}  \>                  \\
auto\_left\_margin         \> {\tt bw}      \> {\tt bw} \>     cub1 wraps from column 0 to last column \\
auto\_right\_margin        \> {\tt am}      \> {\tt am} \>     Terminal has automatic margins\\
back\_color\_erase         \> {\tt bce}     \> {\tt ut} \>     screen erased with background color\\
can\_change                \> {\tt ccc}     \> {\tt cc} \>     terminal can re-define exiting colors\\
ceol\_standout\_glitch     \> {\tt xhp}     \> {\tt xs} \>     Standout not erased by overwriting (hp)\\
col\_addr\_glitch          \> {\tt xhpa}    \> {\tt YA} \>     only positive motion for hpa/mhpa caps\\
cpi\_changes\_res          \> {\tt cpix}    \> {\tt YF} \>     changing character pitch changes resolution\\
cr\_cancels\_micro\_mode   \> {\tt crxm}    \> {\tt YB} \>     using cr turns off micro mode\\
eat\_newline\_glitch       \> {\tt xenl}    \> {\tt xn} \>     newline ignored after 80 cols (Concept)\\
erase\_overstrike          \> {\tt eo}      \> {\tt eo} \>     Can erase overstrikes with a blank\\
generic\_type              \> {\tt gn}      \> {\tt gn} \>     Generic line type (e.g.,, dialup, switch).\\
hard\_copy                 \> {\tt hc}      \> {\tt hc} \>     Hardcopy terminal\\
hard\_cursor               \> {\tt chts}    \> {\tt HC} \>     cursor is hard to see\\
has\_meta\_key             \> {\tt km}      \> {\tt km} \>     Has a meta key (shift, sets parity bit)\\
has\_print\_wheel          \> {\tt daisy}   \> {\tt YC} \>     printer needs operator to change character set\\
has\_status\_line          \> {\tt hs}      \> {\tt hs} \>     Has extra "status line"\\
hue\_lightness\_saturation \> {\tt hls}     \> {\tt hl} \>     terminal uses only HLS color notation\\
                           \>               \>          \>     (Tektronix)\\
insert\_null\_glitch       \> {\tt in}      \> {\tt in} \>     Insert mode distinguishes nulls\\
lpi\_changes\_res          \> {\tt lpix}    \> {\tt YG} \>     changing line pitch changes resolution\\
memory\_above              \> {\tt da}      \> {\tt da} \>     Display may be retained above the screen\\
memory\_below              \> {\tt db}      \> {\tt db} \>     Display may be retained below the screen\\
move\_insert\_mode         \> {\tt mir}     \> {\tt mi} \>     Safe to move while in insert mode\\
move\_standout\_mode       \> {\tt msgr}    \> {\tt ms} \>     Safe to move in standout modes\\
needs\_xon\_xoff           \> {\tt nxon}    \> {\tt nx} \>     padding won't work, xon/xoff required\\
no\_esc\_ctl\_c            \> {\tt xsb}     \> {\tt xb} \>     Beehive (f1=escape, f2=ctrl C)\\
non\_rev\_rmcup            \> {\tt nrrmc}   \> {\tt NR} \>     smcup does not reverse rmcup\\
no\_pad\_char              \> {\tt npc}     \> {\tt NP} \>     pad character does not exist\\
non\_dest\_scroll\_region  \> {\tt ndscr}   \> {\tt ND} \>     scrolling region is non-destructive\\
over\_strike               \> {\tt os}      \> {\tt os} \>     Terminal overstrikes\\
prtr\_silent               \> {\tt mc5i}    \> {\tt 5i} \>     printer won't echo on screen\\
row\_addr\_glitch          \> {\tt xvpa}    \> {\tt YD} \>     only positive motion for vhp/mvpa caps\\
semi\_auto\_right\_margin  \> {\tt sam}     \> {\tt YE} \>     printing in last column causes cr\\
status\_line\_esc\_ok      \> {\tt eslok}   \> {\tt es} \>     Escape can be used on the status line\\
dest\_tabs\_magic\_smso    \> {\tt xt}      \> {\tt xt} \>     Tabs ruin, magic so char (Teleray 1061)\\
tilde\_glitch              \> {\tt hz}      \> {\tt hz} \>     Hazel-tine; can not print \~'s\\
transparent\_underline     \> {\tt ul}      \> {\tt ul} \>     underline character overstrikes\\
xon\_xoff                  \> {\tt xon}     \> {\tt xo} \>     Terminal uses xon/xoff handshaking\\
\end{tabbing}
\end{small}

\subsection{Numbers}
\begin{small}
\begin{tabbing}
12345678901234567890\=12345612\=45678\=901234567890\kill
{\bf Variable} \> {\bf Cap.} \> {\bf Int.}  \> {\bf Description}\\
               \> {\bf Name} \> {\bf Code}  \>                   \\
bit\_image\_entwining      \> {\tt bitwin}  \> {\tt Yo} \>    Undocumented in SYSV\\
buffer\_capacity           \> {\tt bufsz}   \> {\tt Ya} \>    numbers of bytes buffered before printing\\
columns                    \> {\tt cols}    \> {\tt co} \>    Number of columns in a line\\
dot\_vert\_spacing         \> {\tt spinv}   \> {\tt Yb} \>    spacing of dots horizontally in dots per inch\\
dot\_horz\_spacing         \> {\tt spinh}   \> {\tt Yc} \>    spacing of pins vertically in pins per inch\\
init\_tabs                 \> {\tt it}      \> {\tt it} \>    Tabs initially every \# spaces\\
label\_height              \> {\tt lh}      \> {\tt lh} \>    rows in each label\\
label\_width               \> {\tt lw}      \> {\tt lw} \>    columns in each label\\
lines                      \> {\tt lines}   \> {\tt li} \>    Number of lines on screen or page\\
lines\_of\_memory          \> {\tt lm}      \> {\tt lm} \>    Lines of memory if > lines.  0 means varies\\
magic\_cookie\_glitch      \> {\tt xmc}     \> {\tt sg} \>    Number of blank chars left by smso or rmso\\
max\_colors                \> {\tt colors}  \> {\tt Co} \>    maximum numbers of colors on screen\\
max\_micro\_address        \> {\tt maddr}   \> {\tt Yd} \>    maximum value in micro\_...\_address\\
max\_micro\_jump           \> {\tt mjump}   \> {\tt Ye} \>    maximum value in parm\_...\_micro\\
max\_pairs                 \> {\tt pairs}   \> {\tt pa} \>    maximum number of color-pairs on the screen\\
micro\_col\_size           \> {\tt mcs}     \> {\tt Yf} \>    Character step size when in micro mode\\
micro\_line\_size          \> {\tt mls}     \> {\tt Yg} \>    Line step size when in micro mode\\
no\_color\_video           \> {\tt ncv}     \> {\tt NC} \>    video attributes that can't be used with colors\\
number\_of\_pins           \> {\tt npins}   \> {\tt Yh} \>    numbers of pins in print-head\\
num\_labels                \> {\tt nlab}    \> {\tt Nl} \>    number of labels on screen\\
output\_res\_char          \> {\tt orc}     \> {\tt Yi} \>    horizontal resolution in units per line\\
output\_res\_line          \> {\tt orl}     \> {\tt Yj} \>    vertical resolution in units per line\\
output\_res\_horz\_inch    \> {\tt orhi}    \> {\tt Yk} \>    horizontal resolution in units per inch\\
output\_res\_vert\_inch    \> {\tt orvi}    \> {\tt Yl} \>    vertical resolution in units per inch\\
padding\_baud\_rate        \> {\tt pb}      \> {\tt pb} \>    Lowest baud where cr/nl padding is needed\\
virtual\_terminal          \> {\tt vt}      \> {\tt vt} \>    Virtual terminal number (UNIX system)\\
width\_status\_line        \> {\tt wsl}     \> {\tt ws} \>    No. columns in status line
\end{tabbing}
(The following numeric capabilities are present in the SYSV term structure,
but are not yet documented in the man page. Comments are from the term
structure header.)
\begin{tabbing}
12345678901234567890\=12345612\=45678\=901234567890\kill
bit\_image\_type           \> {\tt bitype}  \> {\tt Yp} \>  Type of bit-image device\\
buttons                    \> {\tt btns}    \> {\tt BT} \>  Number of mouse buttons\\
max\_attributes            \> {\tt ma}      \> {\tt ma} \>  Max combined attributes terminal can handle\\
maximum\_windows           \> {\tt wnum}    \> {\tt MW} \>  Max number of definable windows\\
print\_rate                \> {\tt cps}     \> {\tt Ym} \>  Print rate in chars per second\\
wide\_char\_size           \> {\tt widcs}   \> {\tt Yn} \>  Char step size in double wide mode\\
\>\>\>\\
\>\>\>\\
\end{tabbing}
\end{small}



\subsection{Strings}
\begin{small}
\begin{tabbing}
12345678901234567890123\=456123456\=78901\=4567890\kill
{\bf Variable} \> {\bf Cap.} \> {\bf Int.}   \> {\bf Description}\\
               \> {\bf Name} \> {\bf Code}   \>                  \\
acs\_chars                  \> {\tt acsc}      \> {\tt ac} \>   Graphics charset pairs - def=vt100\\
alt\_scancode\_esc          \> {\tt scesa}     \> {\tt S8} \>   Alternate esc for scancode emulation\\
                            \>                 \>          \>   (default is vt100)\\
back\_tab                   \> {\tt cbt}       \> {\tt bt} \>   Back tab (P)\\
bell                        \> {\tt bel}       \> {\tt bl} \>   Audible signal (bell) (P)\\
bit\_image\_repeat          \> {\tt birep}     \> {\tt Xy} \>   Repeat bit image cell \#1 \#2 times\\
                            \>                 \>          \>   (use tparm)\\
bit\_image\_newline         \> {\tt binel}     \> {\tt Zz} \>   Move to next row of the bit image\\
                            \>                 \>          \>   (use tparm)\\
bit\_image\_carriage\_return\> {\tt bicr}      \> {\tt Yv} \>   Move to beginning of same row\\
                            \>                 \>          \>   (use tparm)\\
carriage\_return            \> {\tt cr}        \> {\tt cr} \>   Carriage return (P*)\\
change\_char\_pitch         \> {\tt cpi}       \> {\tt ZA} \>   Change \# chars per inch\\
change\_line\_pitch         \> {\tt lpi}       \> {\tt ZB} \>   Change \# lines per inch\\
change\_res\_horz           \> {\tt chr}       \> {\tt ZC} \>   Change horizontal resolution\\
change\_res\_vert           \> {\tt cvr}       \> {\tt ZD} \>   Change vertical resolution\\
change\_scroll\_region      \> {\tt csr}       \> {\tt cs} \>   Change to lines \#1 through \#2\\
                            \>                 \>          \>   (vt100) (PG)\\
char\_padding               \> {\tt rmp}       \> {\tt rP} \>   Like ip but when in insert mode\\
char\_set\_names            \> {\tt csnm}      \> {\tt Zy} \>   List of character set names\\
clear\_all\_tabs            \> {\tt tbc}       \> {\tt ct} \>   Clear all tab stops (P)\\
clear\_margins              \> {\tt mgc}       \> {\tt MC} \>   Clear all margins (top, bottom, and sides)\\
clear\_screen               \> {\tt clear}     \> {\tt cl} \>   Clear screen and home cursor (P*)\\
clr\_bol                    \> {\tt el1}       \> {\tt cb} \>   Clear to beginning of line\\
clr\_eol                    \> {\tt el}        \> {\tt ce} \>   Clear to end of line (P)\\
clr\_eos                    \> {\tt ed}        \> {\tt cd} \>   Clear to end of display (P*)\\
code\_set\_init             \> {\tt csin}      \> {\tt ci} \>   Init sequence for multiple code sets\\
color\_names                \> {\tt colornm}   \> {\tt Yw} \>   Give name for color \#1\\
column\_address             \> {\tt hpa}       \> {\tt ch} \>   Set cursor column (PG)\\
command\_character          \> {\tt cmdch}     \> {\tt CC} \>   Term. settable cmd char in prototype\\
cursor\_address             \> {\tt cup}       \> {\tt cm} \>   Screen rel. cursor motion row \#1 col \#2\\
                            \>                 \>          \>   (PG)\\
cursor\_down                \> {\tt cud1}      \> {\tt do} \>   Down one line\\
cursor\_home                \> {\tt home}      \> {\tt ho} \>   Home cursor (if no cup)\\
cursor\_invisible           \> {\tt civis}     \> {\tt vi} \>   Make cursor invisible\\
cursor\_left                \> {\tt cub1}      \> {\tt le} \>   Move cursor left one space\\
cursor\_mem\_address        \> {\tt mrcup}     \> {\tt CM} \>   Memory relative cursor addressing\\
cursor\_normal              \> {\tt cnorm}     \> {\tt ve} \>   Make cursor appear normal (undo vs/vi)\\
cursor\_right               \> {\tt cuf1}      \> {\tt nd} \>   Non-destructive space (cursor right)\\
cursor\_to\_ll              \> {\tt ll}        \> {\tt ll} \>   Last line, first column (if no cup)\\
cursor\_up                  \> {\tt cuu1}      \> {\tt up} \>   Upline (cursor up)\\
cursor\_visible             \> {\tt cvvis}     \> {\tt vs} \>   Make cursor very visible\\
define\_bit\_image\_region  \> {\tt defbi}     \> {\tt Yx} \>   Define rectangular bit image region\\
                            \>                 \>          \>   (use tparm)\\
define\_char                \> {\tt defc}      \> {\tt ZE} \>   Define character in a character set\\
delete\_character           \> {\tt dch1}      \> {\tt dc} \>   Delete character (P*)\\
delete\_line                \> {\tt dl1}       \> {\tt dl} \>   Delete line (P*)\\
device\_type                \> {\tt devt}      \> {\tt dv} \>   Indicate language/codeset support\\
dis\_status\_line           \> {\tt dsl}       \> {\tt ds} \>   Disable status line\\
display\_pc\_char           \> {\tt dispc}     \> {\tt S1} \>   Display PC character\\
down\_half\_line            \> {\tt hd}        \> {\tt hd} \>   Half-line down (forward 1/2 linefeed)\\
ena\_acs                    \> {\tt enacs}     \> {\tt eA} \>   enable alternate char set\\
end\_bit\_image\_region     \> {\tt endbi}     \> {\tt Yy} \>   End bit image region (use tparm)\\
enter\_alt\_charset\_mode   \> {\tt smacs}     \> {\tt as} \>   Start alternate character set (P)\\
enter\_am\_mode             \> {\tt smam}      \> {\tt SA} \>   turn on automatic margins\\
enter\_blink\_mode          \> {\tt blink}     \> {\tt mb} \>   Turn on blinking\\
enter\_bold\_mode           \> {\tt bold}      \> {\tt md} \>   Turn on bold (extra bright) mode\\
enter\_ca\_mode             \> {\tt smcup}     \> {\tt ti} \>   String to begin programs that use cup\\
enter\_delete\_mode         \> {\tt smdc}      \> {\tt dm} \>   Delete mode (enter)\\
enter\_dim\_mode            \> {\tt dim}       \> {\tt mh} \>   Turn on half-bright mode\\
enter\_doublewide\_mode     \> {\tt swidm}     \> {\tt ZF} \>   Enable double-wide mode\\
enter\_draft\_quality       \> {\tt sdrfq}     \> {\tt ZG} \>   Set draft-quality printing\\
enter\_insert\_mode         \> {\tt smir}      \> {\tt im} \>   Insert mode (enter);\\
enter\_italics\_mode        \> {\tt sitm}      \> {\tt ZH} \>   Enable italics mode\\
enter\_leftward\_mode       \> {\tt slm}       \> {\tt ZI} \>   Enable leftward carriage motion\\
enter\_micro\_mode          \> {\tt smicm}     \> {\tt ZJ} \>   Enable micro-motion capabilities\\
enter\_near\_letter\_quality\> {\tt snlq}      \> {\tt ZK} \>   Set NLQ printing\\
enter\_normal\_quality      \> {\tt snrmq}     \> {\tt ZL} \>   Set normal quality printing\\
enter\_pc\_charset\_mode    \> {\tt smpch}     \> {\tt S2} \>   Enter PC character display mode\\
enter\_protected\_mode      \> {\tt prot}      \> {\tt mp} \>   Turn on protected mode\\
enter\_reverse\_mode        \> {\tt rev}       \> {\tt mr} \>   Turn on reverse video mode\\
enter\_scancode\_mode       \> {\tt smsc}      \> {\tt S4} \>   Enter PC scancode mode\\
enter\_secure\_mode         \> {\tt invis}     \> {\tt mk} \>   Turn on blank mode (chars invisible)\\
enter\_shadow\_mode         \> {\tt sshm}      \> {\tt ZM} \>   Enable shadow-mode printing\\
enter\_standout\_mode       \> {\tt smso}      \> {\tt so} \>   Begin stand out mode\\
enter\_subscript\_mode      \> {\tt ssubm}     \> {\tt ZN} \>   Enable subscript printing\\
enter\_superscript\_mode    \> {\tt ssupm}     \> {\tt ZO} \>   Enable superscript printing\\
enter\_underline\_mode      \> {\tt smul}      \> {\tt us} \>   Start underscore mode\\
enter\_upward\_mode         \> {\tt sum}       \> {\tt ZP} \>   Enable upward carriage motion\\
enter\_xon\_mode            \> {\tt smxon}     \> {\tt SX} \>   Turn on xon/xoff handshaking\\
erase\_chars                \> {\tt ech}       \> {\tt ec} \>   Erase \#1 characters (PG)\\
exit\_alt\_charset\_mode    \> {\tt rmacs}     \> {\tt ae} \>   End alternate character set (P)\\
exit\_am\_mode              \> {\tt rmam}      \> {\tt RA} \>   Turn off automatic margins\\
exit\_attribute\_mode       \> {\tt sgr0}      \> {\tt me} \>   Turn off all attributes\\
exit\_ca\_mode              \> {\tt rmcup}     \> {\tt te} \>   String to end programs that use cup\\
exit\_delete\_mode          \> {\tt rmdc}      \> {\tt ed} \>   End delete mode\\
exit\_doublewide\_mode      \> {\tt rwidm}     \> {\tt ZQ} \>   Disable doublewide printing\\
exit\_insert\_mode          \> {\tt rmir}      \> {\tt ei} \>   End insert mode\\
exit\_italics\_mode         \> {\tt ritm}      \> {\tt ZR} \>   Disable italic printing\\
exit\_leftward\_mode        \> {\tt rlm}       \> {\tt ZS} \>   Enable rightward (normal) carriage\\
                            \>                 \>          \>   motion\\
exit\_micro\_mode           \> {\tt rmicm}     \> {\tt ZT} \>   Disable micro motion capabilities\\
exit\_pc\_charset\_mode     \> {\tt rmpch}     \> {\tt S3} \>   Disable PC character display\\
exit\_scancode\_mode        \> {\tt rmsc}      \> {\tt S5} \>   Disable PC scancode mode\\
exit\_shadow\_mode          \> {\tt rshm}      \> {\tt ZU} \>   Disable shadow printing\\
exit\_standout\_mode        \> {\tt rmso}      \> {\tt se} \>   End stand out mode\\
exit\_subscript\_mode       \> {\tt rsubm}     \> {\tt ZV} \>   Disable subscript printing\\
exit\_superscript\_mode     \> {\tt rsupm}     \> {\tt ZW} \>   Disable superscript printing\\
exit\_underline\_mode       \> {\tt rmul}      \> {\tt ue} \>   End underscore mode\\
exit\_upward\_mode          \> {\tt rum}       \> {\tt ZX} \>   Enable downward (normal) carriage\\
                            \>                 \>          \>   motion\\
exit\_xon\_mode             \> {\tt rmxon}     \> {\tt RX} \>   turn off xon/xoff handshaking\\
flash\_screen               \> {\tt flash}     \> {\tt vb} \>   Visible bell (may not move cursor)\\
form\_feed                  \> {\tt ff}        \> {\tt ff} \>   Hardcopy terminal page eject (P*)\\
from\_status\_line          \> {\tt fsl}       \> {\tt fs} \>   Return from status line\\
init\_1string               \> {\tt is1}       \> {\tt i1} \>   Terminal initialization string\\
init\_2string               \> {\tt is2}       \> {\tt i2} \>   Terminal initialization string\\
init\_3string               \> {\tt is3}       \> {\tt i3} \>   Terminal initialization string\\
init\_file                  \> {\tt if}        \> {\tt if} \>   Name of file containing is\\
init\_prog                  \> {\tt iprog}     \> {\tt iP} \>   Path name of program for init\\
initialize\_color           \> {\tt initc}     \> {\tt Ic} \>   Initialize the definition of color\\
initialize\_pair            \> {\tt initp}     \> {\tt Ip} \>   Initialize color-pair\\
insert\_character           \> {\tt ich1}      \> {\tt ic} \>   Insert character (P)\\
insert\_line                \> {\tt il1}       \> {\tt al} \>   Add new blank line (P*)\\
insert\_padding             \> {\tt ip}        \> {\tt ip} \>   Insert pad after character inserted (p*)\\
key\_a1         \> {\tt ka1}    \> {\tt K1} \>   Upper left of keypad\\
key\_a3         \> {\tt ka3}    \> {\tt K3} \>   Upper right of keypad\\
key\_b2         \> {\tt kb2}    \> {\tt K2} \>   Center of keypad\\
key\_backspace  \> {\tt kbs}    \> {\tt kb} \>   Sent by backspace key\\
key\_beg        \> {\tt kbeg}   \> {\tt \@1}\>   begin key\\
key\_btab       \> {\tt kcbt}   \> {\tt kB} \>   back-tab key\\
key\_c1         \> {\tt kc1}    \> {\tt K4} \>   Lower left of keypad\\
key\_c3         \> {\tt kc3}    \> {\tt K5} \>   Lower right of keypad\\
key\_cancel     \> {\tt kcan}   \> {\tt \@2}\>   cancel key\\
key\_catab      \> {\tt ktbc}   \> {\tt ka} \>   Sent by clear-all-tabs key\\
key\_clear      \> {\tt kclr}   \> {\tt kC} \>   Sent by clear screen or erase key\\
key\_close      \> {\tt kclo}   \> {\tt \@3}\>   close key\\
key\_command    \> {\tt kcmd}   \> {\tt \@4}\>   command key\\
key\_copy       \> {\tt kcpy}   \> {\tt \@5}\>   copy key\\
key\_create     \> {\tt kcrt}   \> {\tt \@6}\>   create key\\
key\_ctab       \> {\tt kctab}  \> {\tt kt} \>   Sent by clear-tab key\\
key\_dc         \> {\tt kdch1}  \> {\tt kD} \>   Sent by delete character key\\
key\_dl         \> {\tt kdl1}   \> {\tt kL} \>   Sent by delete line key\\
key\_down       \> {\tt kcud1}  \> {\tt kd} \>   Sent by terminal down arrow key\\
key\_eic        \> {\tt krmir}  \> {\tt kM} \>   Sent by rmir or smir in insert mode\\
key\_end        \> {\tt kend}   \> {\tt \@7}\>   end key\\
key\_enter      \> {\tt kent}   \> {\tt \@8}\>   enter/send key\\
key\_eol        \> {\tt kel}    \> {\tt kE} \>   Sent by clear-to-end-of-line key\\
key\_eos        \> {\tt ked}    \> {\tt kS} \>   Sent by clear-to-end-of-screen key\\
key\_exit       \> {\tt kext}   \> {\tt \@9}\>   exit key
\end{tabbing}
\begin{multicols}{2}
\begin{tabbing}
1234567890\=12345\=67890\=1234567890123456790\kill
key\_f0         \> {\tt kf0}    \> {\tt k0} \>   F00 function key\\
key\_f1         \> {\tt kf1}    \> {\tt k1} \>   F01 function key\\
key\_f2         \> {\tt kf2}    \> {\tt k2} \>   F02 function key\\
key\_f3         \> {\tt kf3}    \> {\tt k3} \>   F03 function key\\
key\_f4         \> {\tt kf4}    \> {\tt k4} \>   F04 function key\\
key\_f5         \> {\tt kf5}    \> {\tt k5} \>   F05 function key\\
key\_f6         \> {\tt kf6}    \> {\tt k6} \>   F06 function key\\
key\_f7         \> {\tt kf7}    \> {\tt k7} \>   F07 function key\\
key\_f8         \> {\tt kf8}    \> {\tt k8} \>   F08 function key\\
key\_f9         \> {\tt kf9}    \> {\tt k9} \>   F09 function key\\
key\_f10        \> {\tt kf10}   \> {\tt k;} \>   F10 function key\\
key\_f11        \> {\tt kf11}   \> {\tt F1} \>   F11 function key\\
key\_f12        \> {\tt kf12}   \> {\tt F2} \>   F12 function key\\
key\_f13        \> {\tt kf13}   \> {\tt F3} \>   F13 function key\\
key\_f14        \> {\tt kf14}   \> {\tt F4} \>   F14 function key\\
key\_f15        \> {\tt kf15}   \> {\tt F5} \>   F15 function key\\
key\_f16        \> {\tt kf16}   \> {\tt F6} \>   F16 function key\\
key\_f17        \> {\tt kf17}   \> {\tt F7} \>   F17 function key\\
key\_f18        \> {\tt kf18}   \> {\tt F8} \>   F18 function key\\
key\_f19        \> {\tt kf19}   \> {\tt F9} \>   F19 function key\\
key\_f20        \> {\tt kf20}   \> {\tt FA} \>   F20 function key\\
key\_f21        \> {\tt kf21}   \> {\tt FB} \>   F21 function key\\
key\_f22        \> {\tt kf22}   \> {\tt FC} \>   F22 function key\\
key\_f23        \> {\tt kf23}   \> {\tt FD} \>   F23 function key\\
key\_f24        \> {\tt kf24}   \> {\tt FE} \>   F24 function key\\
key\_f25        \> {\tt kf25}   \> {\tt FF} \>   F25 function key\\
key\_f26        \> {\tt kf26}   \> {\tt FG} \>   F26 function key\\
key\_f27        \> {\tt kf27}   \> {\tt FH} \>   F27 function key\\
key\_f28        \> {\tt kf28}   \> {\tt FI} \>   F28 function key\\
key\_f29        \> {\tt kf29}   \> {\tt FJ} \>   F29 function key\\
key\_f30        \> {\tt kf30}   \> {\tt FK} \>   F30 function key\\
key\_f31        \> {\tt kf31}   \> {\tt FL} \>   F31 function key\\
key\_f32        \> {\tt kf32}   \> {\tt FM} \>   F32 function key\\
key\_f33        \> {\tt kf33}   \> {\tt FN} \>   F33 function key\\
key\_f34        \> {\tt kf34}   \> {\tt FO} \>   F34 function key\\
key\_f35        \> {\tt kf35}   \> {\tt FP} \>   F35 function key\\
key\_f36        \> {\tt kf36}   \> {\tt FQ} \>   F36 function key\\
key\_f37        \> {\tt kf37}   \> {\tt FR} \>   F37 function key\\
key\_f38        \> {\tt kf38}   \> {\tt FS} \>   F38 function key\\
key\_f39        \> {\tt kf39}   \> {\tt FT} \>   F39 function key\\
key\_f40        \> {\tt kf40}   \> {\tt FU} \>   F40 function key\\
key\_f41        \> {\tt kf41}   \> {\tt FV} \>   F41 function key\\
key\_f42        \> {\tt kf42}   \> {\tt FW} \>   F42 function key\\
key\_f43        \> {\tt kf43}   \> {\tt FX} \>   F43 function key\\
key\_f44        \> {\tt kf44}   \> {\tt FY} \>   F44 function key\\
key\_f45        \> {\tt kf45}   \> {\tt FZ} \>   F45 function key\\
key\_f46        \> {\tt kf46}   \> {\tt Fa} \>   F46 function key\\
key\_f47        \> {\tt kf47}   \> {\tt Fb} \>   F47 function key\\
key\_f48        \> {\tt kf48}   \> {\tt Fc} \>   F48 function key\\
key\_f49        \> {\tt kf49}   \> {\tt Fd} \>   F49 function key\\
key\_f50        \> {\tt kf50}   \> {\tt Fe} \>   F50 function key\\
key\_f51        \> {\tt kf51}   \> {\tt Ff} \>   F51 function key\\
key\_f52        \> {\tt kf52}   \> {\tt Fg} \>   F52 function key\\
key\_f53        \> {\tt kf53}   \> {\tt Fh} \>   F53 function key\\
key\_f54        \> {\tt kf54}   \> {\tt Fi} \>   F54 function key\\
key\_f55        \> {\tt kf55}   \> {\tt Fj} \>   F55 function key\\
key\_f56        \> {\tt kf56}   \> {\tt Fk} \>   F56 function key\\
key\_f57        \> {\tt kf57}   \> {\tt Fl} \>   F57 function key\\
key\_f58        \> {\tt kf58}   \> {\tt Fm} \>   F58 function key\\
key\_f59        \> {\tt kf59}   \> {\tt Fn} \>   F59 function key\\
key\_f60        \> {\tt kf60}   \> {\tt Fo} \>   F60 function key\\
key\_f61        \> {\tt kf61}   \> {\tt Fp} \>   F61 function key\\
key\_f62        \> {\tt kf62}   \> {\tt Fq} \>   F62 function key\\
key\_f63        \> {\tt kf63}   \> {\tt Fr} \>   F63 function key
\end{tabbing}
\end{multicols}
\begin{tabbing}
12345678901234567890123\=456123456\=78901\=4567890\kill
key\_find       \> {\tt kfnd}   \> {\tt \@0}\>   find key\\
key\_help       \> {\tt khlp}   \> {\tt \%1}\>   help key\\
key\_home       \> {\tt khome}  \> {\tt kh} \>   Sent by home key\\
key\_ic         \> {\tt kich1}  \> {\tt kI} \>   Sent by ins char/enter ins mode key\\
key\_il         \> {\tt kil1}   \> {\tt kA} \>   Sent by insert line\\
key\_left       \> {\tt kcub1}  \> {\tt kl} \>   Sent by terminal left arrow key\\
key\_ll         \> {\tt kll}    \> {\tt kH} \>   Sent by home-down key\\
key\_mark       \> {\tt kmrk}   \> {\tt \%2}\>   mark key\\
key\_message    \> {\tt kmsg}   \> {\tt \%3}\>   message key\\
key\_move       \> {\tt kmov}   \> {\tt \%4}\>   move key\\
key\_next       \> {\tt knxt}   \> {\tt \%5}\>   next key\\
key\_npage      \> {\tt knp}    \> {\tt kN} \>   Sent by next-page key\\
key\_open       \> {\tt kopn}   \> {\tt \%6}\>   open key\\
key\_options    \> {\tt kopt}   \> {\tt \%7}\>   options key\\
key\_ppage      \> {\tt kpp}    \> {\tt kP} \>   Sent by previous-page key\\
key\_previous   \> {\tt kprv}   \> {\tt \%8}\>   previous key\\
key\_print      \> {\tt kprt}   \> {\tt \%9}\>   print key\\
key\_redo       \> {\tt krdo}   \> {\tt \%0}\>   redo key\\
key\_reference  \> {\tt kref}   \> {\tt \&1}\>   reference key\\
key\_refresh    \> {\tt krfr}   \> {\tt \&2}\>   refresh key\\
key\_replace    \> {\tt krpl}   \> {\tt \&3}\>   replace key\\
key\_restart    \> {\tt krst}   \> {\tt \&4}\>   restart key\\
key\_resume     \> {\tt kres}   \> {\tt \&5}\>   resume key\\
key\_right      \> {\tt kcuf1}  \> {\tt kr} \>   Sent by terminal right arrow key\\
key\_save       \> {\tt ksav}   \> {\tt \&6}\>   save key\\
key\_sbeg       \> {\tt kBEG}   \> {\tt \&9}\>   shifted begin key\\
key\_scancel    \> {\tt kCAN}   \> {\tt \&0}\>   shifted cancel key\\
key\_scommand   \> {\tt kCMD}   \> {\tt *1} \>   shifted command key\\
key\_scopy      \> {\tt kCPY}   \> {\tt *2} \>   shifted copy key\\
key\_screate    \> {\tt kCRT}   \> {\tt *3} \>   shifted create key\\
key\_sdc        \> {\tt kDC}    \> {\tt *4} \>   shifted delete char key\\
key\_sdl        \> {\tt kDL}    \> {\tt *5} \>   shifted delete line key\\
key\_select     \> {\tt kslt}   \> {\tt *6} \>   select key\\
key\_send       \> {\tt kEND}   \> {\tt *7} \>   shifted end key\\
key\_seol       \> {\tt kEOL}   \> {\tt *8} \>   shifted end of line key\\
key\_sexit      \> {\tt kEXT}   \> {\tt *9} \>   shifted exit key\\
key\_sf         \> {\tt kind}   \> {\tt kF} \>   Sent by scroll-forward/down key\\
key\_sfind      \> {\tt kFND}   \> {\tt *0} \>   shifted find key\\
key\_shelp      \> {\tt kHLP}   \> {\tt \#1}\>   shifted help key\\
key\_shome      \> {\tt kHOM}   \> {\tt \#2}\>   shifted home key\\
key\_sic        \> {\tt kIC}    \> {\tt \#3}\>   shifted insert char key\\
key\_sleft      \> {\tt kLFT}   \> {\tt \#4}\>   shifted left key\\
key\_smessage   \> {\tt kMSG}   \> {\tt \%a}\>   shifted message key\\
key\_smove      \> {\tt kMOV}   \> {\tt \%b}\>   shifted move key\\
key\_snext      \> {\tt kNXT}   \> {\tt \%c}\>   shifted next key\\
key\_soptions   \> {\tt kOPT}   \> {\tt \%d}\>   shifted options key\\
key\_sprevious  \> {\tt kPRV}   \> {\tt \%e}\>   shifted previous key\\
key\_sprint     \> {\tt kPRT}   \> {\tt \%f}\>   shifted print key\\
key\_sr         \> {\tt kri}    \> {\tt kR} \>   Sent by scroll-backward/up key\\
key\_sredo      \> {\tt kRDO}   \> {\tt \%g}\>   shifted redo key\\
key\_sreplace   \> {\tt kRPL}   \> {\tt \%h}\>   shifted replace key\\
key\_sright     \> {\tt kRIT}   \> {\tt \%i}\>   shifted right key\\
key\_srsume     \> {\tt kRES}   \> {\tt \%j}\>   shifted resume key\\
key\_ssave      \> {\tt kSAV}   \> {\tt !1} \>   shifted save key\\
key\_ssuspend   \> {\tt kSPD}   \> {\tt !2} \>   shifted suspend key\\
key\_stab       \> {\tt khts}   \> {\tt kT} \>   Sent by set-tab key\\
key\_sundo      \> {\tt kUND}   \> {\tt !3} \>   shifted undo key\\
key\_suspend    \> {\tt kspd}   \> {\tt \&7}\>   suspend key\\
key\_undo       \> {\tt kund}   \> {\tt \&8}\>   undo key\\
key\_up         \> {\tt kcuu1}  \> {\tt ku} \>   Sent by terminal up arrow key\\
keypad\_local   \> {\tt rmkx}   \> {\tt ke} \>   Out of "keypad transmit" mode\\
keypad\_xmit    \> {\tt smkx}   \> {\tt ks} \>   Put terminal in "keypad transmit" mode\\
lab\_f0         \> {\tt lf0}    \> {\tt l0} \>   Labels on function key f0 if not f0\\
lab\_f1         \> {\tt lf1}    \> {\tt l1} \>   Labels on function key f1 if not f1\\
lab\_f2         \> {\tt lf2}    \> {\tt l2} \>   Labels on function key f2 if not f2\\
lab\_f3         \> {\tt lf3}    \> {\tt l3} \>   Labels on function key f3 if not f3\\
lab\_f4         \> {\tt lf4}    \> {\tt l4} \>   Labels on function key f4 if not f4\\
lab\_f5         \> {\tt lf5}    \> {\tt l5} \>   Labels on function key f5 if not f5\\
lab\_f6         \> {\tt lf6}    \> {\tt l6} \>   Labels on function key f6 if not f6\\
lab\_f7         \> {\tt lf7}    \> {\tt l7} \>   Labels on function key f7 if not f7\\
lab\_f8         \> {\tt lf8}    \> {\tt l8} \>   Labels on function key f8 if not f8\\
lab\_f9         \> {\tt lf9}    \> {\tt l9} \>   Labels on function key f9 if not f9\\
lab\_f10        \> {\tt lf10}   \> {\tt la} \>   Labels on function key f10 if not f10\\
label\_on       \> {\tt smln}   \> {\tt LO} \>   turn on soft labels\\
label\_off      \> {\tt rmln}   \> {\tt LF} \>   turn off soft labels\\
meta\_off       \> {\tt rmm}    \> {\tt mo} \>   Turn off "meta mode"\\
meta\_on        \> {\tt smm}    \> {\tt mm} \>   Turn on "meta mode" (8th bit)\\
micro\_column\_address      \> {\tt mhpa}      \> {\tt ZY} \>   Like column\_address for micro adjustment\\
micro\_down                 \> {\tt mcud1}     \> {\tt ZZ} \>   Like cursor\_down for micro adjustment\\
micro\_left                 \> {\tt mcub1}     \> {\tt Za} \>   Like cursor\_left for micro adjustment\\
micro\_right                \> {\tt mcuf1}     \> {\tt Zb} \>   Like cursor\_right for micro adjustment\\
micro\_row\_address         \> {\tt mvpa}      \> {\tt Zc} \>   Like row\_address for micro adjustment\\
micro\_up                   \> {\tt mcuu1}     \> {\tt Zd} \>   Like cursor\_up for micro adjustment\\
newline                     \> {\tt nel}       \> {\tt nw} \>   Newline (behaves like cr followed by lf)\\
order\_of\_pins             \> {\tt porder}    \> {\tt Ze} \>   Matches software buts to print-head pins\\
orig\_colors                \> {\tt oc}        \> {\tt oc} \>   Reset all color pairs\\
orig\_pair                  \> {\tt op}        \> {\tt op} \>   Set default color-pair to original one\\
pad\_char                   \> {\tt pad}       \> {\tt pc} \>   Pad character (rather than null)\\
parm\_dch                   \> {\tt dch}       \> {\tt DC} \>   Delete \#1 chars (PG*)\\
parm\_delete\_line          \> {\tt dl}        \> {\tt DL} \>   Delete \#1 lines (PG*)\\
parm\_down\_cursor          \> {\tt cud}       \> {\tt DO} \>   Move cursor down \#1 lines (PG*)\\
parm\_down\_micro           \> {\tt mcud}      \> {\tt Zf} \>   Like cud for micro adjust\\
parm\_ich                   \> {\tt ich}       \> {\tt IC} \>   Insert \#1 blank chars (PG*)\\
parm\_index                 \> {\tt indn}      \> {\tt SF} \>   Scroll forward \#1 lines (PG)\\
parm\_insert\_line          \> {\tt il}        \> {\tt AL} \>   Add \#1 new blank lines (PG*)\\
parm\_left\_cursor          \> {\tt cub}       \> {\tt LE} \>   Move cursor left \#1 spaces (PG)\\
parm\_left\_micro           \> {\tt mcub}      \> {\tt Zg} \>   Like cul for micro adjust\\
parm\_right\_cursor         \> {\tt cuf}       \> {\tt RI} \>   Move cursor right \#1 spaces (PG*)\\
parm\_right\_micro          \> {\tt mcuf}      \> {\tt Zh} \>   Like cuf for micro adjust\\
parm\_rindex                \> {\tt rin}       \> {\tt SR} \>   Scroll backward \#1 lines (PG)\\
parm\_up\_cursor            \> {\tt cuu}       \> {\tt UP} \>   Move cursor up \#1 lines (PG*)\\
parm\_up\_micro             \> {\tt mcuu}      \> {\tt Zi} \>   Like cuu for micro adjust\\
pkey\_key                   \> {\tt pfkey}     \> {\tt pk} \>   Prog funct key \#1 to type string \#2\\
pkey\_local                 \> {\tt pfloc}     \> {\tt pl} \>   Prog funct key \#1 to execute string \#2\\
pkey\_xmit                  \> {\tt pfx}       \> {\tt px} \>   Prog funct key \#1 to xmit string \#2\\
pkey\_plab                  \> {\tt pfxl}      \> {\tt xl} \>   Program key \#1 to xmit \#2 and show \#3\\
plab\_norm                  \> {\tt pln}       \> {\tt pn} \>   program label \#1 to show string \#2\\
print\_screen               \> {\tt mc0}       \> {\tt ps} \>   Print contents of the screen\\
prtr\_non                   \> {\tt mc5p}      \> {\tt pO} \>   Turn on the printer for \#1 bytes\\
prtr\_off                   \> {\tt mc4}       \> {\tt pf} \>   Turn off the printer\\
prtr\_on                    \> {\tt mc5}       \> {\tt po} \>   Turn on the printer\\
repeat\_char                \> {\tt rep}       \> {\tt rp} \>   Repeat char \#1 \#2 times.  (PG*)\\
req\_for\_input             \> {\tt rfi}       \> {\tt RF} \>   request for input\\
reset\_1string              \> {\tt rs1}       \> {\tt r1} \>   Reset terminal completely to sane modes.\\
reset\_2string              \> {\tt rs2}       \> {\tt r2} \>   Reset terminal completely to sane modes.\\
reset\_3string              \> {\tt rs3}       \> {\tt r3} \>   Reset terminal completely to sane modes.\\
reset\_file                 \> {\tt rf}        \> {\tt rf} \>   Name of file containing reset string\\
restore\_cursor             \> {\tt rc}        \> {\tt rc} \>   Restore cursor to position of last sc\\
row\_address                \> {\tt vpa}       \> {\tt cv} \>   Vertical position absolute (set row) (PG)\\
save\_cursor                \> {\tt sc}        \> {\tt sc} \>   Save cursor position (P)\\
scancode\_escape            \> {\tt scesc}     \> {\tt S7} \>   Escape for scancode emulation\\
scroll\_forward             \> {\tt ind}       \> {\tt sf} \>   Scroll text up (P)\\
scroll\_reverse             \> {\tt ri}        \> {\tt sr} \>   Scroll text down (P)\\
select\_char\_set           \> {\tt scs}       \> {\tt Zj} \>   Select character set\\
set0\_des\_seq              \> {\tt s0ds}      \> {\tt s0} \>   Shift to codeset 0 (EUC set 0, ASCII)\\
set1\_des\_seq              \> {\tt s1ds}      \> {\tt s1} \>   Shift to codeset 1\\
set2\_des\_seq              \> {\tt s2ds}      \> {\tt s2} \>   Shift to codeset 2\\
set3\_des\_seq              \> {\tt s3ds}      \> {\tt s3} \>   Shift to codeset 3\\
set\_a\_background          \> {\tt setab}     \> {\tt AB} \>   Set background color using ANSI escape\\
set\_a\_foreground          \> {\tt setaf}     \> {\tt AF} \>   Set foreground color using ANSI escape\\
set\_attributes             \> {\tt sgr}       \> {\tt sa} \>   Define the video attributes (PG9)\\
set\_background             \> {\tt setb}      \> {\tt Sb} \>   Set current background color\\
set\_bottom\_margin         \> {\tt smgb}      \> {\tt Zk} \>   Set bottom margin at current line\\
set\_bottom\_margin\_parm   \> {\tt smgbp}     \> {\tt Zl} \>   Set bottom line at line \#1 or \#2\\
                            \>                 \>          \>   lines from bottom\\
set\_color\_band            \> {\tt setcolor}  \> {\tt Yz} \>   Change to ribbon color \#1\\
set\_color\_pair            \> {\tt scp}       \> {\tt sp} \>   Set current color pair\\
set\_foreground             \> {\tt setf}      \> {\tt Sf} \>   Set current foreground color\\
set\_left\_margin           \> {\tt smgl}      \> {\tt ML} \>   Set left margin at current line\\
set\_left\_margin\_parm     \> {\tt smglp}     \> {\tt Zm} \>   Set left (right) margin at \#1 (\#2)\\
set\_lr\_margin             \> {\tt smglr}     \> {\tt ML} \>   Set both left and right margins\\
set\_page\_length           \> {\tt slines}    \> {\tt YZ} \>   Set page length to \#1 lines (use tparm)\\
set\_right\_margin          \> {\tt smgr}      \> {\tt MR} \>   Set right margin at current column\\
set\_right\_margin\_parm    \> {\tt smgrp}     \> {\tt Zn} \>   Set right margin at column \#1\\
set\_tab                    \> {\tt hts}       \> {\tt st} \>   Set a tab in all rows, current column\\
set\_tb\_margin             \> {\tt smgtb}     \> {\tt MT} \>   Sets both top and bottom margins\\
set\_top\_margin            \> {\tt smgt}      \> {\tt Zo} \>   Set top margin at current line\\
set\_top\_margin\_parm      \> {\tt smgtp}     \> {\tt Zp} \>   Set top margin at line \#1\\
set\_window                 \> {\tt wind}      \> {\tt wi} \>   Current window is lines \#1-\#2 cols \#3-\#4\\
start\_bit\_image           \> {\tt sbim}      \> {\tt Zq} \>   Start printing bit image graphics\\
start\_char\_set\_def       \> {\tt scsd}      \> {\tt Zr} \>   Start definition of a character set\\
stop\_bit\_image            \> {\tt rbim}      \> {\tt Zs} \>   End printing bit image graphics\\
stop\_char\_set\_def        \> {\tt rcsd}      \> {\tt Zt} \>   End definition of character set\\
subscript\_characters       \> {\tt subcs}     \> {\tt Zu} \>   List of subscriptable chars\\
superscript\_characters     \> {\tt supcs}     \> {\tt Zv} \>   List of superscriptable chars\\
tab                         \> {\tt ht}        \> {\tt ta} \>   Tab to next 8 space hardware tab stop\\
these\_cause\_cr            \> {\tt docr}      \> {\tt Zw} \>   These characters cause a CR\\
to\_status\_line            \> {\tt tsl}       \> {\tt ts} \>   Go to status line, column \#1\\
underline\_char             \> {\tt uc}        \> {\tt uc} \>   Underscore one char and move past it\\
up\_half\_line              \> {\tt hu}        \> {\tt hu} \>   Half-line up (reverse 1/2 linefeed)\\
xoff\_character             \> {\tt xoffc}     \> {\tt XF} \>   XON character\\
xon\_character              \> {\tt xonc}      \> {\tt XN} \>   XOFF character
\end{tabbing}
              (The following string capabilities are  present  in
              the  SYSVr term structure, but are not documented
              in the man page.  Comments are from the term structure
              header.)
\begin{tabbing}
12345678901234567890123\=456123456\=78901\=4567890\kill
label\_format               \> {\tt fln}     \> {\tt Lf} \>   ??\\
set\_clock                  \> {\tt sclk}    \> {\tt SC} \>   Set time-of-day clock\\
display\_clock              \> {\tt dclk}    \> {\tt DK} \>   Display time-of-day clock\\
remove\_clock               \> {\tt rmclk}   \> {\tt RC} \>   Remove time-of-day clock??\\
create\_window              \> {\tt cwin}    \> {\tt CW} \>   Define win \#1 to go from \#2,\#3 to \#4,\#5\\
goto\_window                \> {\tt wingo}   \> {\tt WG} \>   Goto window \#1\\
hangup                      \> {\tt hup}     \> {\tt HU} \>   Hang up phone\\
dial\_phone                 \> {\tt dial}    \> {\tt DI} \>   Dial phone number \#1\\
quick\_dial                 \> {\tt qdial}   \> {\tt QD} \>   Dial phone number \#1, without\\
                            \>               \>          \>   progress detection\\
tone                        \> {\tt tone}    \> {\tt TO} \>   Select touch tone dialing\\
pulse                       \> {\tt pulse}   \> {\tt PU} \>   Select pulse dialing\\
flash\_hook                 \> {\tt hook}    \> {\tt fh} \>   Flash the switch hook\\
fixed\_pause                \> {\tt pause}   \> {\tt PA} \>   Pause for 2-3 seconds\\
wait\_tone                  \> {\tt wait}    \> {\tt WA} \>   Wait for dial tone\\
user0                       \> {\tt u0}      \> {\tt u0} \>   User string \# 0\\
user1                       \> {\tt u1}      \> {\tt u1} \>   User string \# 1\\
user2                       \> {\tt u2}      \> {\tt u2} \>   User string \# 2\\
user3                       \> {\tt u3}      \> {\tt u3} \>   User string \# 3\\
user4                       \> {\tt u4}      \> {\tt u4} \>   User string \# 4\\
user5                       \> {\tt u5}      \> {\tt u5} \>   User string \# 5\\
user6                       \> {\tt u6}      \> {\tt u6} \>   User string \# 6\\
user7                       \> {\tt u7}      \> {\tt u7} \>   User string \# 7\\
user8                       \> {\tt u8}      \> {\tt u8} \>   User string \# 8\\
user9                       \> {\tt u9}      \> {\tt u9} \>   User string \# 9\\
get\_mouse                  \> {\tt getm}    \> {\tt Gm} \>   Curses should get button events\\
key\_mouse                  \> {\tt kmous}   \> {\tt Km} \>   ??\\
mouse\_info                 \> {\tt minfo}   \> {\tt Mi} \>   Mouse status information\\
pc\_term\_options           \> {\tt pctrm}   \> {\tt S6} \>   PC terminal options\\
req\_mouse\_pos             \> {\tt reqmp}   \> {\tt RQ} \>   Request mouse position report\\
zero\_motion                \> {\tt zerom}   \> {\tt Zx} \>   No motion for the subsequent character
\end{tabbing}
\end{small}




\section{$[$N$]$Curses Function Overview}

In the following text you will find an overview over the different
(n)curses packages. In the first column is the bsd-curses (as it
is in slackware 2.1.0 and in Sun-OS 4.x), in the second is
the sysv-curses (in Sun-OS 5.4 / Solaris 2) and in the third
is the ncurses (version \ncver).

In the fourth column is a reference to the page in the text where
the function is described (if it is actually described).

\begin{itemize}
\item [x] package has this function
\item [n] function not yet implemented
\end{itemize}

\begin{multicols}{2}
\begin{scriptsize}
\begin{tabbing}
12345678901234567890\=6789012\=3456790\=1234\=5678901234567890\kill
{\bf Function} \> {\bf BSD} \> {\bf SYSV} \> {\bf Nc.}    \> {\bf Page}\\
{\tt \_init\_trace()}            \>   \>   \> x   \>  \funref{fun__init_trace}       \\
{\tt \_traceattr(mode)}          \>   \>   \> x   \>  \funref{fun__traceattr}       \\
{\tt \_tracef(char *, ...)}      \>   \>   \> x   \>  \funref{fun__tracef}       \\
{\tt addbytes(...)}              \> x \>   \>     \>         \\
{\tt addch(ch)}                  \> x \> x \> x   \>  \funref{fun_addch}       \\
{\tt addchnstr(...)}             \>   \> x \> x   \>  \funref{fun_addchnstr}       \\
{\tt addchstr(chstr)}            \>   \> x \> x   \>  \funref{fun_addchstr}       \\
{\tt addnstr(...)}               \>   \> x \> x   \>  \funref{fun_addnstr}       \\  
{\tt addnwstr(...)}              \>   \> x \>     \>         \\
{\tt addstr(str)}                \> x \> x \> x   \>  \funref{fun_addstr}       \\
{\tt addwch(...)}                \>   \> x \>     \>         \\          
{\tt addwchnstr(...)}            \>   \> x \>     \>         \\          
{\tt addwchstr(...)}             \>   \> x \>     \>         \\          
{\tt addwstr(...)}               \>   \> x \>     \>         \\          
{\tt adjcurspos()}               \>   \> x \>     \>         \\       
{\tt attroff(attr)}              \>   \> x \> x   \>  \funref{fun_attroff}       \\
{\tt attron(attr)}               \>   \> x \> x   \>  \funref{fun_attron}       \\
{\tt attrset(attr)}              \>   \> x \> x   \>  \funref{fun_attrset}       \\
{\tt baudrate()}                 \> x \> x \> x   \>  \funref{fun_baudrate}       \\
{\tt beep()}                     \>   \> x \> x   \>  \funref{fun_beep}       \\
{\tt bkgd(ch)}                   \>   \> x \> x   \>  \funref{fun_bkgd}       \\
{\tt bkgdset(ch)}                \>   \> x \> x   \>  \funref{fun_bkgdset}       \\
{\tt border(...)}                \>   \> x \> x   \>  \funref{fun_border}       \\
{\tt box(...)}                   \> x \> x \> x   \>  \funref{fun_box}       \\
{\tt can\_change\_color()}       \>   \> x \> x   \>  \funref{fun_can_change_color}       \\
{\tt cbreak()}                   \> x \> x \> x   \>  \funref{fun_cbreak}       \\
{\tt clear()}                    \> x \> x \> x   \>  \funref{fun_clear}       \\
{\tt clearok(...)}               \> x \> x \> x   \>  \funref{fun_clearok}       \\
{\tt clrtobot()}                 \> x \> x \> x   \>  \funref{fun_clrtobot}       \\
{\tt clrtoeol()}                 \> x \> x \> x   \>  \funref{fun_clrtoeol}       \\
{\tt color\_content(...)}        \>   \> x \> x   \>  \funref{fun_color_content}       \\
{\tt copywin(...)}               \>   \> x \> x   \>  \funref{fun_copywin}       \\ 
{\tt crmode()}                   \> x \> x \> x   \>  \funref{fun_crmode}       \\
{\tt curs\_set(bf)}              \>   \> x \> x   \>  \funref{fun_curs_set}       \\
{\tt curserr()}                  \>   \> x \>     \>         \\
{\tt def\_prog\_mode()}          \>   \> x \> x   \>  \funref{fun_def_prog_mode}       \\
{\tt def\_shell\_mode()}         \>   \> x \> x   \>  \funref{fun_def_shell_mode}       \\
{\tt del\_curterm(...)}          \>   \> x \> x   \>  \funref{fun_del_curterm}       \\
{\tt delay\_output(ms)}          \>   \> x \> x   \>  \funref{fun_delay_output}       \\
{\tt delch()}                    \> x \> x \> x   \>  \funref{fun_delch}       \\
{\tt deleteln()}                 \> x \> x \> x   \>  \funref{fun_deleteln}       \\
{\tt delscreen(...)}             \>   \> x \> x,n \>  \funref{fun_delscreen}       \\
{\tt delwin(win)}                \> x \> x \> x   \>  \funref{fun_delwin}       \\
{\tt derwin(...)}                \>   \> x \> x   \>  \funref{fun_derwin}       \\
{\tt doupdate()}                 \>   \> x \> x   \>  \funref{fun_doupdate}       \\
{\tt drainio(int)}               \>   \> x \>     \>         \\
{\tt dupwin(win)}                \>   \> x \> x   \>  \funref{fun_dupwin}       \\
{\tt echo()}                     \> x \> x \> x   \>  \funref{fun_echo}       \\
{\tt echochar(ch)}               \>   \> x \> x   \>  \funref{fun_echochar}       \\
{\tt echowchar(ch)}              \>   \> x \>     \>         \\         
{\tt endwin()}                   \> x \> x \> x   \>  \funref{fun_endwin}       \\
{\tt erase()}                    \> x \> x \> x   \>  \funref{fun_erase}       \\
{\tt erasechar()}                \> x \> x \> x   \>  \funref{fun_erasechar}       \\
{\tt filter()}                   \>   \> x \> x   \>  \funref{fun_filter}       \\
{\tt flash()}                    \>   \> x \> x   \>  \funref{fun_flash}       \\
{\tt flushinp()}                 \>   \> x \> x   \>  \funref{fun_flushinp}       \\
{\tt flushok(...)}               \> x \>   \>     \>         \\
{\tt garbagedlines(...)}         \>   \> x \>     \>         \\
{\tt garbagedwin(win)}           \>   \> x \>     \>         \\
{\tt getattrs(win)}              \>   \> x \> x   \>  \funref{fun_getattrs}       \\
{\tt getbegyx(...)}              \>   \> x \> x   \>  \funref{fun_getbegyx}       \\
{\tt getbkgd(win)}               \>   \> x \>     \>         \\
{\tt getbmap()}                  \>   \> x \>     \>         \\
{\tt getcap(str)}                \> x \>   \>     \>         \\
{\tt getch()}                    \> x \> x \> x   \>  \funref{fun_getch}       \\
{\tt getmaxx(win)}               \>   \> x \> x   \>  \funref{fun_getmaxx}       \\
{\tt getmaxy(win)}               \>   \> x \> x   \>  \funref{fun_getmaxy}       \\
{\tt getmaxyx(...)}              \>   \> x \> x   \>  \funref{fun_getmaxyx}       \\
{\tt getmouse()}                 \>   \> x \>     \>         \\
{\tt getnwstr(...)}              \>   \> x \>     \>         \\          
{\tt getparyx(...)}              \>   \> x \> x   \>  \funref{fun_getparyx}       \\
{\tt getstr(str)}                \> x \> x \> x   \>  \funref{fun_getstr}       \\
{\tt getsyx(...)}                \>   \> x \> x   \>  \funref{fun_getsyx}       \\
{\tt gettmode()}                 \> x \> x \>     \>         \\
{\tt getwch(...)}                \>   \> x \>     \>         \\          
{\tt getwin(...)}                \>   \> x \>     \>         \\          
{\tt getwin(FILE *)}             \>   \> x \> x,n \>  \funref{fun_getwin}       \\
{\tt getwstr(...)}               \>   \> x \>     \>         \\          
{\tt getyx(...)}                 \> x \> x \> x   \>  \funref{fun_getyx}       \\
{\tt halfdelay(t)}               \>   \> x \> x   \>  \funref{fun_halfdelay}       \\
{\tt has\_colors()}              \>   \> x \> x   \>  \funref{fun_has_colors}       \\
{\tt has\_ic()}                  \>   \> x \> x,n \>  \funref{fun_has_ic}       \\
{\tt has\_il()}                  \>   \> x \> x,n \>  \funref{fun_has_il}       \\
{\tt hline(...)}                 \>   \> x \> x   \>  \funref{fun_hline}       \\
{\tt idcok(...)}                 \>   \> x \> x,n \>  \funref{fun_idcok}       \\
{\tt idlok(...)}                 \> x \> x \> x   \>  \funref{fun_idlok}       \\
{\tt immedok(...)}               \>   \> x \> x   \>  \funref{fun_immedok}       \\
{\tt inch()}                     \> x \> x \> x   \>  \funref{fun_inch}       \\
{\tt inchnstr(...)}              \>   \> x \> x,n \>  \funref{fun_inchnstr}       \\
{\tt inchstr(...)}               \>   \> x \> x,n \>  \funref{fun_inchstr}       \\
{\tt init\_color(...)}           \>   \> x \> x   \>  \funref{fun_init_color}       \\
{\tt init\_pair(...)}            \>   \> x \> x   \>  \funref{fun_init_pair}       \\
{\tt initscr()}                  \> x \> x \> x   \>  \funref{fun_initscr}       \\
{\tt innstr(...)}                \>   \> x \> x,n \>  \funref{fun_innstr}       \\
{\tt innwstr(...)}               \>   \> x \>     \>         \\          
{\tt insch(c)}                   \> x \> x \> x   \>  \funref{fun_insch}       \\
{\tt insdelln(n)}                \>   \> x \> x   \>  \funref{fun_insdelln}       \\
{\tt insertln()}                 \> x \> x \> x   \>  \funref{fun_insertln}       \\
{\tt insnstr(...)}               \>   \> x \> x   \>  \funref{fun_insnstr}       \\
{\tt insstr(str)}                \>   \> x \> x   \>  \funref{fun_insstr}       \\
{\tt instr(str)}                 \>   \> x \> x,n \>  \funref{fun_instr}       \\
{\tt inswch(...)}                \>   \> x \>     \>         \\          
{\tt inswstr(...)}               \>   \> x \>     \>         \\          
{\tt intrflush(...)}             \>   \> x \> x   \>  \funref{fun_intrflush}       \\
{\tt inwch(...)}                 \>   \> x \>     \>         \\          
{\tt inwchnstr(...)}             \>   \> x \>     \>         \\          
{\tt inwchstr(...)}              \>   \> x \>     \>         \\
{\tt inwchstr(...)}              \>   \> x \>     \>         \\          
{\tt inwstr(...)}                \>   \> x \>     \>         \\          
{\tt is\_linetouched(...)}       \>   \> x \> x   \>  \funref{fun_is_linetouched}       \\
{\tt is\_wintouched(win)}        \>   \> x \> x   \>  \funref{fun_is_wintouched}       \\
{\tt isendwin()}                 \>   \> x \> x   \>  \funref{fun_isendwin}       \\
{\tt keyname(c)}                 \>   \> x \> x   \>  \funref{fun_keyname}       \\
{\tt keypad(...)}                \>   \> x \> x   \>  \funref{fun_keypad}       \\
{\tt killchar()}                 \> x \> x \> x   \>  \funref{fun_killchar}       \\
{\tt leaveok(...)}               \> x \> x \> x   \>  \funref{fun_leaveok}       \\
{\tt longname()}                 \> x \> x \> x   \>  \funref{fun_longname}       \\
{\tt map\_button(long)}          \>   \> x \>     \>         \\
{\tt meta(...)}                  \>   \> x \> x   \>  \funref{fun_meta}       \\
{\tt mouse\_off(long)}           \>   \> x \>     \>         \\
{\tt mouse\_on(long)}            \>   \> x \>     \>         \\
{\tt mouse\_set(long)}           \>   \> x \>     \>         \\
{\tt move(...)}                  \> x \> x \> x   \>  \funref{fun_move}       \\
{\tt movenextch()}               \>   \> x \>     \>         \\       
{\tt moveprevch()}               \>   \> x \>     \>         \\       
{\tt mvaddbytes(...)}            \> x \>   \>     \>         \\
{\tt mvaddch(...)}               \> x \> x \> x   \>  \funref{fun_mvaddch}       \\
{\tt mvaddchnstr(...)}           \>   \> x \> x   \>  \funref{fun_mvaddchnstr}       \\
{\tt mvaddchstr(...)}            \>   \> x \> x   \>  \funref{fun_mvaddchstr}       \\
{\tt mvaddnstr(...)}             \>   \> x \> x   \>  \funref{fun_mvaddnstr}       \\
{\tt mvaddnwstr(...)}            \>   \> x \>     \>         \\          
{\tt mvaddstr(...)}              \> x \> x \> x   \>  \funref{fun_mvaddstr}       \\
{\tt mvaddwch(...)}              \>   \> x \>     \>         \\          
{\tt mvaddwchnstr(...)}          \>   \> x \>     \>         \\          
{\tt mvaddwchstr(...)}           \>   \> x \>     \>         \\          
{\tt mvaddwstr(...)}             \>   \> x \>     \>         \\          
{\tt mvcur(...)}                 \> x \> x \> x   \>  \funref{fun_mvcur}       \\
{\tt mvdelch(...)}               \> x \> x \> x   \>  \funref{fun_mvdelch}       \\
{\tt mvderwin(...)}              \>   \> x \> x,n \>  \funref{fun_mvderwin}       \\
{\tt mvgetch(...)}               \> x \> x \> x   \>  \funref{fun_mvgetch}       \\
{\tt mvgetnwstr(...)}            \>   \> x \>     \>         \\         
{\tt mvgetstr(...)}              \> x \> x \> x   \>  \funref{fun_mvgetstr}       \\
{\tt mvgetwch(...)}              \>   \> x \>     \>         \\          
{\tt mvgetwstr(...)}             \>   \> x \>     \>         \\          
{\tt mvhline(...)}               \>   \> x \>     \>         \\
{\tt mvinch(...)}                \> x \> x \> x   \>  \funref{fun_mvinch}       \\
{\tt mvinchnstr(...)}            \>   \> x \> x,n \>  \funref{fun_mvinchnstr}       \\
{\tt mvinchstr(...)}             \>   \> x \> x,n \>  \funref{fun_mvinchstr}       \\
{\tt mvinnstr(...)}              \>   \> x \> x,n \>  \funref{fun_mvinnstr}       \\
{\tt mvinnwstr(...)}             \>   \> x \>     \>         \\          
{\tt mvinsch(...)}               \> x \> x \> x   \>  \funref{fun_mvinsch}       \\
{\tt mvinsnstr(...)}             \>   \> x \> x   \>  \funref{fun_mvinsnstr}       \\
{\tt mvinsnwstr(...)}            \>   \> x \>     \>         \\          
{\tt mvinsstr(...)}              \>   \> x \> x   \>  \funref{fun_mvinsstr}       \\
{\tt mvinstr(...)}               \>   \> x \> x,n \>  \funref{fun_mvinstr}       \\
{\tt mvinswch(...)}              \>   \> x \>     \>         \\          
{\tt mvinswstr(...)}             \>   \> x \>     \>         \\          
{\tt mvinwch(...)}               \>   \> x \>     \>         \\          
{\tt mvinwchnstr(...)}           \>   \> x \>     \>         \\         
{\tt mvinwchstr(...)}            \>   \> x \>     \>         \\          
{\tt mvinwstr(...)}              \>   \> x \>     \>         \\          
{\tt mvprintw(...)}              \> x \> x \> x   \>  \funref{fun_mvprintw}       \\
{\tt mvscanw(...)}               \> x \> x \> x   \>  \funref{fun_mvscanw}       \\
{\tt mvvline(...)}               \>   \> x \>     \>         \\
{\tt mvwaddbytes(...)}           \> x \>   \>     \>         \\
{\tt mvwaddch(...)}              \> x \> x \> x   \>  \funref{fun_mvwaddch}       \\
{\tt mvwaddchnstr(...)}          \>   \> x \> x   \>  \funref{fun_mvwaddchnstr}       \\
{\tt mvwaddchstr(...)}           \>   \> x \> x   \>  \funref{fun_mvwaddchstr}       \\
{\tt mvwaddnstr(...)}            \>   \> x \> x   \>  \funref{fun_mvwaddnstr}       \\
{\tt mvwaddnwstr(...)}           \>   \> x \>     \>         \\          
{\tt mvwaddstr(...)}             \> x \> x \> x   \>  \funref{fun_mvwaddstr}       \\
{\tt mvwaddwch(...)}             \>   \> x \>     \>         \\          
{\tt mvwaddwchnstr(...)}         \>   \> x \>     \>         \\          
{\tt mvwaddwchstr(...)}          \>   \> x \>     \>         \\          
{\tt mvwaddwstr(...)}            \>   \> x \>     \>         \\          
{\tt mvwdelch(...)}              \> x \> x \> x   \>  \funref{fun_mvwdelch}       \\
{\tt mvwgetch(...)}              \> x \> x \> x   \>  \funref{fun_mvwgetch}       \\
{\tt mvwgetnwstr(...)}           \>   \> x \>     \>         \\          
{\tt mvwgetstr(...)}             \> x \> x \> x   \>  \funref{fun_mvwgetstr}       \\
{\tt mvwgetwch(...)}             \>   \> x \>     \>         \\          
{\tt mvwgetwstr(...)}            \>   \> x \>     \>         \\          
{\tt mvwhline(...)}              \>   \> x \>     \>         \\
{\tt mvwin(...)}                 \> x \> x \> x   \>  \funref{fun_mvwin}       \\
{\tt mvwinch(...)}               \> x \> x \> x   \>  \funref{fun_mvwinch}       \\
{\tt mvwinchnstr(...)}           \>   \> x \> x,n \>  \funref{fun_mvwinchnstr}       \\
{\tt mvwinchstr(...)}            \>   \> x \> x,n \>  \funref{fun_mvwinchstr}       \\
{\tt mvwinnstr(...)}             \>   \> x \> x,n \>  \funref{fun_mvwinnstr}       \\
{\tt mvwinnwstr(...)}            \>   \> x \>     \>         \\          
{\tt mvwinsch(...)}              \> x \> x \> x   \>  \funref{fun_mvwinsch}       \\
{\tt mvwinsnstr(...)}            \>   \> x \> x   \>  \funref{fun_mvwinsnstr}       \\
{\tt mvwinsstr(...)}             \>   \> x \> x   \>  \funref{fun_mvwinsstr}       \\
{\tt mvwinstr(...)}              \>   \> x \> x,n \>  \funref{fun_mvwinstr}       \\
{\tt mvwinswch(...)}             \>   \> x \>     \>         \\         
{\tt mvwinswstr(...)}            \>   \> x \>     \>         \\          
{\tt mvwinwch(...)}              \>   \> x \>     \>         \\          
{\tt mvwinwchnstr(...)}          \>   \> x \>     \>         \\          
{\tt mvwinwchstr(...)}           \>   \> x \>     \>         \\          
{\tt mvwinwstr(...)}             \>   \> x \>     \>         \\          
{\tt mvwprintw(...)}             \> x \> x \> x   \>  \funref{fun_mvwprintw}       \\
{\tt mvwscanw(...)}              \> x \> x \> x   \>  \funref{fun_mvwscanw}       \\
{\tt mvwvline(...)}              \>   \> x \>     \>         \\
{\tt napms(ms)}                  \>   \> x \> x   \>  \funref{fun_napms}       \\
{\tt newkey(...)}                \>   \> x \>     \>         \\
{\tt newpad(...)}                \>   \> x \> x   \>  \funref{fun_newpad}       \\  
{\tt newscreen(...)}             \>   \> x \>     \>         \\
{\tt newterm(...)}               \>   \> x \> x   \>  \funref{fun_newterm}       \\
{\tt newwin(...)}                \> x \> x \> x   \>  \funref{fun_newwin}       \\
{\tt nl()}                       \> x \> x \> x   \>  \funref{fun_nl}       \\
{\tt nocbreak()}                 \> x \> x \> x   \>  \funref{fun_nocbreak}       \\
{\tt nocrmode()}                 \> x \> x \> x   \>  \funref{fun_nocrmode}       \\
{\tt nodelay(...)}               \>   \> x \> x   \>  \funref{fun_nodelay}       \\
{\tt noecho()}                   \> x \> x \> x   \>  \funref{fun_noecho}       \\
{\tt nonl()}                     \> x \> x \> x   \>  \funref{fun_nonl}       \\
{\tt noqiflush()}                \>   \> x \> x,n \>  \funref{fun_noqiflush}       \\
{\tt noraw()}                    \> x \> x \> x   \>  \funref{fun_noraw}       \\
{\tt notimeout(...)}             \>   \> x \> x   \>  \funref{fun_notimeout}       \\
{\tt overlay(...)}               \> x \> x \> x   \>  \funref{fun_overlay}       \\
{\tt overwrite(...)}             \> x \> x \> x   \>  \funref{fun_overwrite}       \\
{\tt pair\_content(...)}         \>   \> x \> x   \>  \funref{fun_pair_content}       \\
{\tt pechochar(...)}             \>   \> x \> x   \>  \funref{fun_pechochar}       \\
{\tt pechowchar(...)}            \>   \> x \>     \>         \\          
{\tt pnoutrefresh(...)}          \>   \> x \> x   \>  \funref{fun_pnoutrefresh}       \\
{\tt prefresh(...)}              \>   \> x \> x   \>  \funref{fun_prefresh}       \\
{\tt printw(...)}                \> x \> x \> x   \>  \funref{fun_printw}       \\
{\tt putp(char *)}               \>   \> x \> x   \>  \funref{fun_putp}       \\
{\tt putwin(...)}                \>   \> x \> x,n \>  \funref{fun_putwin}       \\
{\tt qiflush()}                  \>   \> x \> x,n \>  \funref{fun_qiflush}       \\
{\tt raw()}                      \> x \> x \> x   \>  \funref{fun_raw}       \\
{\tt redrawwin(win)}             \>   \> x \> x   \>  \funref{fun_redrawwin}       \\
{\tt refresh()}                  \> x \> x \> x   \>  \funref{fun_refresh}       \\
{\tt request\_mouse\_pos()}      \>   \> x \>     \>         \\
{\tt reset\_prog\_mode()}        \>   \> x \> x   \>  \funref{fun_reset_prog_mode}       \\
{\tt reset\_shell\_mode()}       \>   \> x \> x   \>  \funref{fun_reset_shell_mode}       \\
{\tt resetty()}                  \> x \> x \> x   \>  \funref{fun_resetty}       \\
{\tt restartterm(...)}           \>   \> x \> x,n \>  \funref{fun_restartterm}       \\
{\tt ripoffline(...)}            \>   \> x \> x   \>  \funref{fun_ripoffline}       \\
{\tt savetty()}                  \> x \> x \> x   \>  \funref{fun_savetty}       \\
{\tt scanw(...)}                 \> x \> x \> x   \>  \funref{fun_scanw}       \\
{\tt scr\_dump(char *)}          \>   \> x \> x,n \>  \funref{fun_scr_dump}       \\
{\tt scr\_init(char *)}          \>   \> x \> x,n \>  \funref{fun_scr_init}       \\
{\tt scr\_restore(char *)}       \>   \> x \> x,n \>  \funref{fun_scr_restore}       \\
{\tt scr\_set(char *)}           \>   \> x \> x,n \>  \funref{fun_scr_set}       \\
{\tt scrl(n)}                    \>   \> x \> x   \>  \funref{fun_scrl}       \\
{\tt scroll(win)}                \> x \> x \> x   \>  \funref{fun_scroll}       \\
{\tt scrollok(...)}              \> x \> x \> x   \>  \funref{fun_scrollok}       \\
{\tt set\_curterm(...)}          \>   \> x \> x   \>  \funref{fun_set_curterm}       \\
{\tt set\_term(...)}             \>   \> x \> x   \>  \funref{fun_set_term}       \\
{\tt setcurscreen(SCREEN *)}     \>   \> x \>     \>         \\
{\tt setscrreg(...)}             \>   \> x \> x   \>  \funref{fun_setscrreg}       \\
{\tt setsyx(...)}                \>   \> x \> x   \>  \funref{fun_setsyx}       \\
{\tt setterm(char *)}            \> x \> x \> x   \>  \funref{fun_setterm}       \\
{\tt setupterm(...)}             \>   \> x \> x   \>  \funref{fun_setupterm}       \\
{\tt slk\_attroff(attr)}         \>   \> x \> x,n \>  \funref{fun_slk_attroff}       \\
{\tt slk\_attron(attr)}          \>   \> x \> x,n \>  \funref{fun_slk_attron}       \\
{\tt slk\_attrset(attr)}         \>   \> x \> x,n \>  \funref{fun_slk_attrset}       \\
{\tt slk\_clear()}               \>   \> x \> x   \>  \funref{fun_slk_clear}       \\
{\tt slk\_init(fmt)}             \>   \> x \> x   \>  \funref{fun_slk_init}       \\
{\tt slk\_label(labnum)}         \>   \> x \> x   \>  \funref{fun_slk_label}       \\
{\tt slk\_noutrefresh()}         \>   \> x \> x   \>  \funref{fun_slk_noutrefresh}       \\
{\tt slk\_refresh()}             \>   \> x \> x   \>  \funref{fun_slk_refresh}       \\
{\tt slk\_restore()}             \>   \> x \> x   \>  \funref{fun_slk_restore}       \\
{\tt slk\_set(...)}              \>   \> x \> x   \>  \funref{fun_slk_set}       \\
{\tt slk\_touch()}               \>   \> x \> x   \>  \funref{fun_slk_touch}       \\
{\tt standend()}                 \> x \> x \> x   \>  \funref{fun_standend}       \\
{\tt standout()}                 \> x \> x \> x   \>  \funref{fun_standout}       \\
{\tt start\_color()}             \>   \> x \> x   \>  \funref{fun_start_color}       \\
{\tt subpad(...)}                \>   \> x \> x   \>  \funref{fun_subpad}       \\
{\tt subwin(...)}                \> x \> x \> x   \>  \funref{fun_subwin}       \\
{\tt syncok(...)}                \>   \> x \> x,n \>  \funref{fun_syncok}       \\
{\tt termattrs()}                \>   \> x \> x,n \>  \funref{fun_termattrs}       \\
{\tt termname()}                 \>   \> x \> x,n \>  \funref{fun_termname}       \\
{\tt tgetent(...)}               \>   \> x \> x   \>  \funref{fun_nc_tgetent}       \\
{\tt tgetflag(char [2])}         \>   \> x \> x   \>  \funref{fun_nc_tgetflag}       \\
{\tt tgetnum(char [2])}          \>   \> x \> x   \>  \funref{fun_nc_tgetnum}       \\
{\tt tgetstr(...)}               \>   \> x \> x   \>  \funref{fun_nc_tgetstr}       \\
{\tt tgoto(...)}                 \>   \> x \> x   \>  \funref{fun_tgoto}       \\
{\tt tigetflag(...)}             \>   \> x \> x   \>  \funref{fun_tigetflag}       \\
{\tt tigetnum(...)}              \>   \> x \> x   \>  \funref{fun_tigetnum}       \\
{\tt tigetstr(...)}              \>   \> x \> x   \>  \funref{fun_tigetstr}       \\
{\tt timeout(t)}                 \>   \> x \> x   \>  \funref{fun_timeout}       \\
{\tt touchline(...)}             \> x \> x \> x   \>  \funref{fun_touchline}       \\
{\tt touchwin(win)}              \> x \> x \> x   \>  \funref{fun_touchwin}       \\
{\tt tparm(...)}                 \>   \> x \> x   \>  \funref{fun_tparm}       \\
{\tt tputs(...)}                 \>   \>   \> x   \>  \funref{fun_nc_tputs}       \\
{\tt traceoff()}                 \>   \> x \> x   \>  \funref{fun_traceoff}       \\
{\tt traceon()}                  \>   \> x \> x   \>  \funref{fun_traceon}       \\
{\tt typeahead(fd)}              \>   \> x \> x   \>  \funref{fun_typeahead}       \\
{\tt unctrl(chtype c)}           \>   \> x \> x   \>  \funref{fun_unctrl}       \\
{\tt ungetch(ch)}                \>   \> x \> x   \>  \funref{fun_ungetch}       \\
{\tt ungetwch(c)}                \>   \> x \>     \>         \\          
{\tt untouchwin(win)}            \>   \> x \> x   \>  \funref{fun_untouchwin}       \\
{\tt use\_env(bf)}               \>   \> x \> x   \>  \funref{fun_use_env}       \\
{\tt vidattr(...)}               \>   \> x \> x   \>  \funref{fun_vidattr}       \\
{\tt vidputs(...)}               \>   \> x \> x   \>  \funref{fun_vidputs}       \\
{\tt vidupdate(...)}             \>   \> x \>     \>         \\
{\tt vline(...)}                 \>   \> x \> x   \>  \funref{fun_vline}       \\
{\tt vwprintw(...)}              \>   \> x \> x   \>  \funref{fun_vwprintw}       \\
{\tt vwscanw(...)}               \>   \> x \> x   \>  \funref{fun_vwscanw}       \\
{\tt waddbytes(...)}             \> x \>   \>     \>         \\
{\tt waddch(...)}                \> x \> x \> x   \>  \funref{fun_waddch}       \\
{\tt waddchnstr(...)}            \>   \> x \> x   \>  \funref{fun_waddchnstr}       \\
{\tt waddchstr(...)}             \>   \> x \> x   \>  \funref{fun_waddchstr}       \\
{\tt waddnstr(...)}              \>   \> x \> x   \>  \funref{fun_waddnstr}       \\
{\tt waddnwstr(...)}             \>   \> x \>     \>         \\          
{\tt waddstr(...)}               \> x \> x \> x   \>  \funref{fun_waddstr}       \\
{\tt waddwch(...)}               \>   \> x \>     \>         \\          
{\tt waddwchnstr(...)}           \>   \> x \>     \>         \\          
{\tt waddwchstr(...)}            \>   \> x \>     \>         \\          
{\tt waddwstr(...)}              \>   \> x \>     \>         \\          
{\tt wadjcurspos(win)}           \>   \> x \>     \>         \\          
{\tt wattroff(...)}              \>   \> x \> x   \>  \funref{fun_wattroff}       \\
{\tt wattron(...)}               \>   \> x \> x   \>  \funref{fun_wattron}       \\
{\tt wattrset(...)}              \>   \> x \> x   \>  \funref{fun_wattrset}       \\
{\tt wbkgd(...)}                 \>   \> x \> x   \>  \funref{fun_wbkgd}       \\
{\tt wbkgdset(...)}              \>   \> x \> x   \>  \funref{fun_wbkgdset}       \\
{\tt wborder(...)}               \>   \> x \> x   \>  \funref{fun_wborder}       \\
{\tt wclear(win)}                \> x \> x \> x   \>  \funref{fun_wclear}       \\
{\tt wclrtobot(win)}             \> x \> x \> x   \>  \funref{fun_wclrtobot}       \\
{\tt wclrtoeol(win)}             \> x \> x \> x   \>  \funref{fun_wclrtoeol}       \\
{\tt wcursyncup(win)}            \>   \> x \> x,n \>  \funref{fun_wcursyncup}       \\
{\tt wdelch(win)}                \> x \> x \> x   \>  \funref{fun_wdelch}       \\
{\tt wdeleteln(win)}             \> x \> x \> x   \>  \funref{fun_wdeleteln}       \\
{\tt wechochar(...)}             \>   \> x \> x   \>  \funref{fun_wechochar}       \\
{\tt wechowchar(...)}            \>   \> x \>     \>         \\         
{\tt werase(win)}                \> x \> x \> x   \>  \funref{fun_werase}       \\
{\tt wgetch(win)}                \> x \> x \> x   \>  \funref{fun_wgetch}       \\
{\tt wgetnstr(...)}              \>   \> x \> x   \>  \funref{fun_wgetnstr}       \\
{\tt wgetnwstr(...)}             \>   \> x \>     \>         \\          
{\tt wgetstr(...)}               \> x \> x \> x   \>  \funref{fun_wgetstr}       \\
{\tt wgetwch(...)}               \>   \> x \>     \>         \\          
{\tt wgetwstr(...)}              \>   \> x \>     \>         \\          
{\tt whline()}                   \>   \> x \>     \>         \\
{\tt whline(...)}                \>   \> x \>     \>         \\
{\tt whline(...)}                \>   \> x \> x   \>  \funref{fun_whline}       \\
{\tt winch(win)}                 \> x \> x \> x   \>  \funref{fun_winch}       \\
{\tt winchnstr(...)}             \>   \> x \> x,n \>  \funref{fun_winchnstr}       \\
{\tt winchstr(...)}              \>   \> x \> x,n \>  \funref{fun_winchstr}       \\
{\tt winnstr(...)}               \>   \> x \> x,n \>  \funref{fun_winnstr}       \\
{\tt winnwstr(...)}              \>   \> x \>     \>         \\          
{\tt winsch(...)}                \> x \> x \> x   \>  \funref{fun_winsch}       \\
{\tt winsdelln(...)}             \> x \> x \> x   \>  \funref{fun_winsdelln}       \\
{\tt winsertln(win)}             \>   \> x \> x   \>  \funref{fun_winsertln}       \\
{\tt winsnstr(...)}              \>   \> x \> x   \>  \funref{fun_winsnstr}       \\
{\tt winsnwstr(...)}             \>   \> x \>     \>         \\          
{\tt winsstr(...)}               \>   \> x \> x   \>  \funref{fun_winsstr}       \\
{\tt winstr(...)}                \>   \> x \> x,n \>  \funref{fun_winstr}       \\
{\tt winswch(...)}               \>   \> x \>     \>         \\          
{\tt winswstr(...)}              \>   \> x \>     \>         \\         
{\tt winwch(...)}                \>   \> x \>     \>         \\          
{\tt winwchnstr(...)}            \>   \> x \>     \>         \\          
{\tt winwchstr(...)}             \>   \> x \>     \>         \\          
{\tt winwstr(...)}               \>   \> x \>     \>         \\          
{\tt wmouse\_position(...)}      \>   \> x \>     \>         \\
{\tt wmove(...)}                 \> x \> x \> x   \>  \funref{fun_wmove}       \\
{\tt wmovenextch(win)}           \>   \> x \>     \>         \\          
{\tt wmoveprevch(win)}           \>   \> x \>     \>         \\          
{\tt wnoutrefresh(win)}          \>   \> x \> x   \>  \funref{fun_wnoutrefresh}       \\
{\tt wprintw(...)}               \> x \> x \> x   \>  \funref{fun_wprintw}       \\
{\tt wredrawln(...)}             \>   \> x \> x   \>  \funref{fun_wredrawln}       \\
{\tt wrefresh(win)}              \> x \> x \> x   \>  \funref{fun_wrefresh}       \\
{\tt wscanw(...)}                \> x \> x \> x   \>  \funref{fun_wscanw}       \\
{\tt wscrl(...)}                 \>   \> x \> x   \>  \funref{fun_wscrl}       \\
{\tt wsetscrreg(...)}            \>   \> x \> x   \>  \funref{fun_wsetscrreg}       \\
{\tt wstandend(win)}             \> x \> x \> x   \>  \funref{fun_wstandend}       \\
{\tt wstandout(win)}             \> x \> x \> x   \>  \funref{fun_wstandout}       \\
{\tt wsyncdown(win)}             \>   \> x \> x,n \>  \funref{fun_wsyncdown}       \\
{\tt wsyncup(win)}               \>   \> x \> x,n \>  \funref{fun_wsyncup}       \\
{\tt wtimeout(...)}              \>   \> x \> x   \>  \funref{fun_wtimeout}       \\
{\tt wtouchln(...)}              \>   \> x \> x   \>  \funref{fun_wtouchln}       \\
{\tt wvline()}                   \>   \> x \>     \>         \\
{\tt wvline(...)}                \>   \> x \>     \>         \\
{\tt wvline(...)}                \>   \> x \> x   \>  \funref{fun_wvline}       \\
\end{tabbing}
\end{scriptsize}
\end{multicols}




To be continued...

\endinput
